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.
This commit is contained in:
Emmanuel Lepage Vallee 2016-02-01 00:15:28 -05:00
parent 3167affe99
commit 7f6bd3c673
1 changed files with 14 additions and 3 deletions

View File

@ -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