From a7f7cab564be66db91369b614391e620788189c1 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 4 Jun 2016 16:10:54 +0200 Subject: [PATCH] wibox: Remember the screen that was assigned If screens overlap, the wibox should still remember which of the possible screens it is assigned to. Signed-off-by: Uli Schlachter --- lib/wibox/init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/wibox/init.lua b/lib/wibox/init.lua index e4f4fdf1f..6a4fb4d38 100644 --- a/lib/wibox/init.lua +++ b/lib/wibox/init.lua @@ -63,6 +63,11 @@ function wibox:find_widgets(x, y) end function wibox:get_screen() + if self.screen_assigned and self.screen_assigned.valid then + return self.screen_assigned + else + self.screen_assigned = nil + end local sgeos = {} for s in capi.screen do @@ -78,6 +83,10 @@ function wibox:set_screen(s) self.x = s.geometry.x self.y = s.geometry.y end + + -- Remember this screen so things work correctly if screens overlap and + -- (x,y) is not enough to figure out the correct screen. + self.screen_assigned = s end for _, k in pairs{ "buttons", "struts", "geometry", "get_xproperty", "set_xproperty" } do