Oh, this missed the list obviously.

On 05/08/2012 12:22 AM, dodo wrote:
i mean, now that it returns false, it will invoke hide a second time,
because we said prompt to do so (done_callback).
Right. I forgot that exec runs done_callback as well.
it will also run `function (s) end`, which is only invoked, every time
spawn is invoked.
This was intentional. It is a bad idea to split the functionality between perform_action() and exec_callback. If I call the function perform_action() then I better be sure it performs every action it is required to.

Updated patch is attached.

--
Alexander Yakushev

"If or if-not. There is no try..catch-based flow control in Clojure."
-- Master Joda

>From 5d9add4b9461f907b877086b7434b883b2083cf0 Mon Sep 17 00:00:00 2001
From: Alexander Yakushev <[email protected]>
Date: Tue, 8 May 2012 01:16:31 +0300
Subject: [PATCH] menubar: Properly stop the keygrabber

After some recent keygrabber changes the menubar's application
execution was broken. This commit fixes it.

Signed-off-by: Alexander Yakushev <[email protected]>
---
 lib/menubar/init.lua.in |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/menubar/init.lua.in b/lib/menubar/init.lua.in
index 58497a9..4b2d36e 100644
--- a/lib/menubar/init.lua.in
+++ b/lib/menubar/init.lua.in
@@ -101,8 +101,9 @@ local function perform_action(o)
         return true, "", new_prompt
     elseif shownitems[current_item].cmdline then
         awful.util.spawn(shownitems[current_item].cmdline)
-        hide()
-        return true
+        -- Let awful.prompt execute dummy exec_callback and
+        -- done_callback to stop the keygrabber properly.
+        return false
     end
 end
 
-- 
1.7.10.1

Reply via email to