Fixes errors in max layout (#30)

If one of the clients was maximised (like PDF viewer) an error was
thrown and visual artifact left on the screen.

This patch fixes it by:

  1. Making last condition in draw_shape more robust - this fixes the error.
  2. Adding missing local variable to change_tag.
This commit is contained in:
przymusp 2020-05-28 22:53:22 +02:00 committed by GitHub
parent e0d43e607a
commit 3d2cd785a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -135,9 +135,9 @@ local function draw_shape(s,collection,current_idx,icon_f,y,text_height)
cr3:show_layout(pango_l) cr3:show_layout(pango_l)
-- Draw an arrow -- Draw an arrow
if k == current_idx-1 then if current_idx and k == current_idx-1 then
create_arrow(cr3,dx,0,width,height,1) create_arrow(cr3,dx,0,width,height,1)
elseif k == current_idx+1 then else
create_arrow(cr3,dx,0,width,height,nil) create_arrow(cr3,dx,0,width,height,nil)
end end
@ -283,6 +283,7 @@ function module.display_tags(s,direction,c,is_swap,is_max)
end end
function module.change_tag(mod,key,event,direction,is_swap,is_max) function module.change_tag(mod,key,event,direction,is_swap,is_max)
local s = capi.client.focus and capi.client.focus.screen or capi.mouse.screen
change_tag(s,direction,is_swap) change_tag(s,direction,is_swap)
return true return true
end end