From cefa14d1bd589a0115405a860ae8bdb2477a9cb6 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Wed, 4 Jan 2017 04:56:54 -0500 Subject: [PATCH] layout: Fix the magnifier layout It was broken since the dynamic screen support was merged. Fix #1338 --- lib/awful/layout/suit/magnifier.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/awful/layout/suit/magnifier.lua b/lib/awful/layout/suit/magnifier.lua index f30d7eeb..fb4df4c8 100644 --- a/lib/awful/layout/suit/magnifier.lua +++ b/lib/awful/layout/suit/magnifier.lua @@ -54,6 +54,10 @@ function magnifier.mouse_resize_handler(c, corner, x, y) end, corner .. "_corner") end +local function get_screen(s) + return s and capi.screen[s] +end + function magnifier.arrange(p) -- Fullscreen? local area = p.workarea @@ -64,7 +68,7 @@ function magnifier.arrange(p) local fidx -- Check that the focused window is on the right screen - if focus and focus.screen ~= p.screen then focus = nil end + if focus and focus.screen ~= get_screen(p.screen) then focus = nil end -- If no window is focused or focused window is not tiled, take the first tiled one. if (not focus or focus.floating) and #cls > 0 then