From a1a1c9eb280837c1fd2065352c4f62284ce1bd01 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 1 Feb 2016 00:15:28 -0500 Subject: [PATCH] Fix drawable position calculation The position of the drawable wasn't taken into account. This does not fix the bug reported by Minde where the manu position is correct the first time, but off the second, this is due to something else. --- init.lua | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 391085b..04cd497 100644 --- a/init.lua +++ b/init.lua @@ -6,9 +6,9 @@ local aw_button = require( "awful.button" ) local beautiful = require( "beautiful" ) -- Define some wibox.widget extensions -local function set_tooltip(self, text) +local function set_tooltip(self, text, args) if not text then return end - self._tooltip = tooltip(self,text) + self._tooltip = tooltip(self,text, args) end local function set_menu(self,menu,button) @@ -25,7 +25,18 @@ local function set_menu(self,menu,button) m = menu(self) end if not m then return end - m.parent_geometry = geo + + local dgeo = geo.drawable.drawable:geometry() + -- The geometry is a mix of the drawable and widget one + local geo2 = { + x = dgeo.x + geo.x, + y = dgeo.y + geo.y, + width = geo.width , + height = geo.height , + drawable = geo.drawable , + } + + m.parent_geometry = geo2 m.visible = not m.visible end) for k, v in pairs(bt) do