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:
parent
eab27bdd8c
commit
a1a1c9eb28
17
init.lua
17
init.lua
|
@ -6,9 +6,9 @@ local aw_button = require( "awful.button" )
|
||||||
local beautiful = require( "beautiful" )
|
local beautiful = require( "beautiful" )
|
||||||
|
|
||||||
-- Define some wibox.widget extensions
|
-- Define some wibox.widget extensions
|
||||||
local function set_tooltip(self, text)
|
local function set_tooltip(self, text, args)
|
||||||
if not text then return end
|
if not text then return end
|
||||||
self._tooltip = tooltip(self,text)
|
self._tooltip = tooltip(self,text, args)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function set_menu(self,menu,button)
|
local function set_menu(self,menu,button)
|
||||||
|
@ -25,7 +25,18 @@ local function set_menu(self,menu,button)
|
||||||
m = menu(self)
|
m = menu(self)
|
||||||
end
|
end
|
||||||
if not m then return 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
|
m.visible = not m.visible
|
||||||
end)
|
end)
|
||||||
for k, v in pairs(bt) do
|
for k, v in pairs(bt) do
|
||||||
|
|
Loading…
Reference in New Issue