Fix tooltip.set_geometry: provide textbox context

Closes https://github.com/awesomeWM/awesome/pull/467.
This commit is contained in:
Daniel Hahler 2015-09-22 13:13:08 +02:00
parent f2e554de91
commit 7cbf3e8bee
1 changed files with 2 additions and 1 deletions

View File

@ -82,8 +82,9 @@ end
-- @tparam tooltip self A tooltip object.
local function set_geometry(self)
local my_geo = self.wibox:geometry()
local textbox_context = {dpi=beautiful.xresources.get_dpi(mouse.screen)}
-- calculate width / height
local n_w, n_h = self.textbox:fit(nil, -1, -1) -- Hack! :(
local n_w, n_h = self.textbox:fit(textbox_context, -1, -1) -- Hack! :(
n_w = n_w + self.marginbox.left + self.marginbox.right
n_h = n_h + self.marginbox.top + self.marginbox.bottom
if my_geo.width ~= n_w or my_geo.height ~= n_h then