From ca02ec1bbe475635a33b6ca856294e0477e6fd74 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 9 May 2016 23:14:55 -0400 Subject: [PATCH] widget.button: Release the button when the mouse leave This isn't correct, but it avoid a bug where the button stay pressed forever if the mouse leave while it's pressed. --- lib/awful/widget/button.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/awful/widget/button.lua b/lib/awful/widget/button.lua index 8189bfc33..eaaafb288 100644 --- a/lib/awful/widget/button.lua +++ b/lib/awful/widget/button.lua @@ -39,6 +39,9 @@ function button.new(args) end w:set_image(args.image) w:buttons(abutton({}, 1, function () orig_set_image(w, img_press) end, function () orig_set_image(w, img_release) end)) + + w:connect_signal("mouse::leave", function(self) orig_set_image(self, img_release) end) + return w end