Hi, recently there were two e-mails to the user mailing list about populating awful tooltips with external timers and omitting timer_function argument to the tooltip. It couldn't be done;

Without timer_function argument set_geometry() is never called. show function only calls place() which fails to display a tooltip since it has no proper geometry.

Attached is a patch to change this, which I'm hoping could be included.



---------- Forwarded message ----------
Date: Sun, 25 Oct 2009 05:41:26
From: Alexander Barinov <[email protected]>
To: Awesome Users <[email protected]>
Subject: Tooltip problem

Hi,

I am using awesome 3.4 trying to create custom statusbar widgets with
tooltips. I use the following code:

    widgets.clock_text = widget({type = "textbox"})
    widgets.clock_icon = widget({type = "imagebox"})
    widgets.clock_icon.image = image(config.home .. "icons/clock.png")
    widgets.clock_tooltip = awful.tooltip({objects = {widgets.clock_text, 
widgets.clock_icon}})

    local function update_clock()
        widgets.clock_text.text = " " .. tostring(tonumber(os.date("%k"))) .. 
os.date(":%M ")
        widgets.clock_tooltip:set_text(os.date("%A, %d %B %Y"))
    end

update_clock() is then called regularly. The problem is, while clock
information updates as it should, no tooltip appears when I place
mouse over clock widgets.

What am I doing wrong?
From 0864a62974a94a800a8a5e4591157740217234df Mon Sep 17 00:00:00 2001
From: Adrian C. (anrxc) <[email protected]>
Date: Sat, 7 Nov 2009 20:09:39 +0100
Subject: [PATCH] awful.tooltip: call set_geometry on show()

Function set_geometry was never called if the timer_function argument
was omitted. show function only called place() which would not display
a tooltip since it didn't have proper geometry.

Signed-off-by: Adrian C. (anrxc) <[email protected]>
---
 lib/awful/tooltip.lua.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/awful/tooltip.lua.in b/lib/awful/tooltip.lua.in
index 1c30975..582aa7e 100644
--- a/lib/awful/tooltip.lua.in
+++ b/lib/awful/tooltip.lua.in
@@ -97,7 +97,7 @@ local function show(self)
             data[self].timer:start()
         end
     end
-    place(self)
+    set_geometry(self)
     self.wibox.visible = true
     self.visible = true
 end
@@ -180,7 +180,7 @@ local function new(args)
     local my_textbox = widget({
         type = "textbox",
         name = "tooltip_textbox",
-        align="right"})
+        align= "right"})
 
     -- private data
     data[self] = {
-- 
1.6.5.2

Reply via email to