From 4711354b5d666c1bf2da90e0ae1c97f0d67ea631 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 4 Nov 2012 21:53:38 +0100 Subject: [PATCH] awful.tooltip: Update geometry in set_text (FS#956) Signed-off-by: Uli Schlachter --- lib/awful/tooltip.lua.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/awful/tooltip.lua.in b/lib/awful/tooltip.lua.in index efdcc7ae7..e7f29edee 100644 --- a/lib/awful/tooltip.lua.in +++ b/lib/awful/tooltip.lua.in @@ -81,7 +81,6 @@ local function set_geometry(self) local n_w, n_h = self.widget:fit(-1, -1) if my_geo.width ~= n_w or my_geo.height ~= n_h then self.wibox:geometry({ width = n_w, height = n_h }) - place(self) end if not self.wibox.visible then place(self) @@ -125,6 +124,7 @@ local function set_text(self, text) self.widget:set_font(data[self].font) self.widget:set_markup('' .. text .. "") + set_geometry(self) end --- Change the tooltip's update interval. @@ -167,7 +167,7 @@ end --- Create a new tooltip and link it to a widget. -- @param args Arguments for tooltip creation may containt:
-- timeout: The timeout value for update_func.
--- timer_function: A function to dynamicaly change the tooltip +-- timer_function: A function to dynamically change the tooltip -- text.
-- objects: A list of objects linked to the tooltip.
-- @return The created tooltip. @@ -201,14 +201,13 @@ local function new(args) data[self].timer = timer { timeout = args.timeout and args.timeout or 1 } data[self].timer_function = function() self:set_text(args.timer_function()) - set_geometry(self) end data[self].timer:connect_signal("timeout", data[self].timer_function) end -- set tooltip properties self.wibox.visible = false - -- Who want a non ontop tooltip ? + -- Who wants a non ontop tooltip ? self.wibox.ontop = true self.wibox:set_widget(my_textbox) self.widget = my_textbox