mouse.resize: Handle when there is no selected tag

This should be very rare, but _is_ possible.
This commit is contained in:
Emmanuel Lepage Vallee 2016-06-27 02:15:32 -04:00
parent 4e6283e5ad
commit 722879bcf7
1 changed files with 4 additions and 3 deletions

View File

@ -218,16 +218,17 @@ function mouse.resize_handler(c, context, hints)
if hints and context and context:find("mouse.*") then if hints and context and context:find("mouse.*") then
-- This handler only handle the floating clients. If the client is tiled, -- This handler only handle the floating clients. If the client is tiled,
-- then it let the layouts handle it. -- then it let the layouts handle it.
local lay = c.screen.selected_tag.layout local t = c.screen.selected_tag
local lay = t and t.layout or nil
if lay == layout.suit.floating or c.floating then if (lay and lay == layout.suit.floating) or c.floating then
c:geometry { c:geometry {
x = hints.x, x = hints.x,
y = hints.y, y = hints.y,
width = hints.width, width = hints.width,
height = hints.height, height = hints.height,
} }
elseif lay.resize_handler then elseif lay and lay.resize_handler then
lay.resize_handler(c, context, hints) lay.resize_handler(c, context, hints)
end end
end end