From 23613bac0548acdab7adc9a3469abc8bd32d3eda Mon Sep 17 00:00:00 2001 From: actionless Date: Fri, 1 Sep 2017 22:43:07 +0200 Subject: [PATCH 1/2] fix(awful: widget: calendar_popup): hover was not working anymore if hiding popup by clicking on it --- lib/awful/widget/calendar_popup.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/awful/widget/calendar_popup.lua b/lib/awful/widget/calendar_popup.lua index e204b10a6..7115eccc1 100644 --- a/lib/awful/widget/calendar_popup.lua +++ b/lib/awful/widget/calendar_popup.lua @@ -332,8 +332,14 @@ local function get_cal_wibox(caltype, args) ret:set_widget(widget) ret:buttons(gears.table.join( - abutton({ }, 1, function () ret.visible=false end), - abutton({ }, 3, function () ret.visible=false end), + abutton({ }, 1, function () + ret.visible=false + ret._calendar_clicked=false + end), + abutton({ }, 3, function () + ret.visible=false + ret._calendar_clicked=false + end), abutton({ }, 4, function () ret:call_calendar(-1) end), abutton({ }, 5, function () ret:call_calendar( 1) end) )) From c9fbecd1e8afdc0a3bb4f9285fa2f2a480f1d656 Mon Sep 17 00:00:00 2001 From: actionless Date: Fri, 1 Sep 2017 22:43:57 +0200 Subject: [PATCH 2/2] refactor(awful: widget: calendar_popup): s/_calendar_clicked/_calendar_clicked_on/ --- lib/awful/widget/calendar_popup.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/awful/widget/calendar_popup.lua b/lib/awful/widget/calendar_popup.lua index 7115eccc1..87095e632 100644 --- a/lib/awful/widget/calendar_popup.lua +++ b/lib/awful/widget/calendar_popup.lua @@ -256,24 +256,24 @@ function calendar_popup:attach(widget, position, args) if args.on_hover == nil then args.on_hover=true end widget:buttons(gears.table.join( abutton({ }, 1, function () - if not self.visible or self._calendar_clicked then + if not self.visible or self._calendar_clicked_on then self:call_calendar(0, position) self.visible = not self.visible end - self._calendar_clicked = self.visible + self._calendar_clicked_on = self.visible end), abutton({ }, 4, function () self:call_calendar(-1) end), abutton({ }, 5, function () self:call_calendar( 1) end) )) if args.on_hover then widget:connect_signal("mouse::enter", function () - if not self._calendar_clicked then + if not self._calendar_clicked_on then self:call_calendar(0, position) self.visible = true end end) widget:connect_signal("mouse::leave", function () - if not self._calendar_clicked then + if not self._calendar_clicked_on then self.visible = false end end) @@ -334,11 +334,11 @@ local function get_cal_wibox(caltype, args) ret:buttons(gears.table.join( abutton({ }, 1, function () ret.visible=false - ret._calendar_clicked=false + ret._calendar_clicked_on=false end), abutton({ }, 3, function () ret.visible=false - ret._calendar_clicked=false + ret._calendar_clicked_on=false end), abutton({ }, 4, function () ret:call_calendar(-1) end), abutton({ }, 5, function () ret:call_calendar( 1) end)