From e55cc7c9124de48dd4fed9393d4600983a267239 Mon Sep 17 00:00:00 2001 From: Peter Nerlich Date: Mon, 15 Oct 2018 12:09:20 +0200 Subject: [PATCH 1/3] stop keygrabber on hide through click fixes #2434 --- lib/awful/hotkeys_popup/widget.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/hotkeys_popup/widget.lua b/lib/awful/hotkeys_popup/widget.lua index 8125ecae3..57d0d2a87 100644 --- a/lib/awful/hotkeys_popup/widget.lua +++ b/lib/awful/hotkeys_popup/widget.lua @@ -451,8 +451,8 @@ function widget.new(args) }) mywibox:set_widget(pages[1]) mywibox:buttons(gtable.join( - awful.button({ }, 1, function () mywibox.visible=false end), - awful.button({ }, 3, function () mywibox.visible=false end) + awful.button({ }, 1, function () mywibox.visible=false awful.keygrabber:stop() end), + awful.button({ }, 3, function () mywibox.visible=false awful.keygrabber:stop() end) )) local widget_obj = {} From 7231087bdbf2778f87d0f88aa1ae51730720e8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Lepage=20Vall=C3=A9e?= Date: Mon, 17 Dec 2018 09:37:08 -0500 Subject: [PATCH 2/3] Update widget.lua --- lib/awful/hotkeys_popup/widget.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/awful/hotkeys_popup/widget.lua b/lib/awful/hotkeys_popup/widget.lua index 57d0d2a87..b4da06e66 100644 --- a/lib/awful/hotkeys_popup/widget.lua +++ b/lib/awful/hotkeys_popup/widget.lua @@ -451,8 +451,8 @@ function widget.new(args) }) mywibox:set_widget(pages[1]) mywibox:buttons(gtable.join( - awful.button({ }, 1, function () mywibox.visible=false awful.keygrabber:stop() end), - awful.button({ }, 3, function () mywibox.visible=false awful.keygrabber:stop() end) + awful.button({ }, 1, function () mywibox.visible=false awful.keygrabber.stop() end), + awful.button({ }, 3, function () mywibox.visible=false awful.keygrabber.stop() end) )) local widget_obj = {} From 1da5554fdc3a558bc0ab4a421bd5f1e91bc58815 Mon Sep 17 00:00:00 2001 From: actionless Date: Mon, 17 Dec 2018 16:27:09 +0100 Subject: [PATCH 3/3] fix(hotkeys_popup): rebase fix for keygrabber instance --- lib/awful/hotkeys_popup/widget.lua | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/awful/hotkeys_popup/widget.lua b/lib/awful/hotkeys_popup/widget.lua index b4da06e66..f8efb46a6 100644 --- a/lib/awful/hotkeys_popup/widget.lua +++ b/lib/awful/hotkeys_popup/widget.lua @@ -443,6 +443,10 @@ function widget.new(args) border_color = self.border_color, shape = self.shape, }) + local widget_obj = { + current_page = 1, + wibox = mywibox, + } mywibox:geometry({ x = wa.x + math.floor((wa.width - width - self.border_width*2) / 2), y = wa.y + math.floor((wa.height - height - self.border_width*2) / 2), @@ -451,13 +455,10 @@ function widget.new(args) }) mywibox:set_widget(pages[1]) mywibox:buttons(gtable.join( - awful.button({ }, 1, function () mywibox.visible=false awful.keygrabber.stop() end), - awful.button({ }, 3, function () mywibox.visible=false awful.keygrabber.stop() end) + awful.button({ }, 1, function () widget_obj:hide() end), + awful.button({ }, 3, function () widget_obj:hide() end) )) - local widget_obj = {} - widget_obj.current_page = 1 - widget_obj.wibox = mywibox function widget_obj.page_next(_self) if _self.current_page == #pages then return end _self.current_page = _self.current_page + 1 @@ -473,6 +474,9 @@ function widget.new(args) end function widget_obj.hide(_self) _self.wibox.visible = false + if _self.keygrabber then + awful.keygrabber.stop(_self.keygrabber) + end end return widget_obj @@ -526,7 +530,7 @@ function widget.new(args) local help_wibox = self._cached_wiboxes[s][joined_groups] help_wibox:show() - return awful.keygrabber.run(function(_, key, event) + help_wibox.keygrabber = awful.keygrabber.run(function(_, key, event) if event == "release" then return end if key then if key == "Next" then @@ -534,11 +538,11 @@ function widget.new(args) elseif key == "Prior" then help_wibox:page_prev() else - awful.keygrabber.stop() help_wibox:hide() end end end) + return help_wibox.keygrabber end --- Add hotkey descriptions for third-party applications.