Skip to content

Commit

Permalink
use on-button-release event instead of buggy on-button-press #199
Browse files Browse the repository at this point in the history
  • Loading branch information
nwg-piotr committed Apr 10, 2023
1 parent 78c51ce commit d687bdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nwg_panel/modules/swaync.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, settings, icons_path, panel_position):

if settings["on-left-click"] or settings["on-right-click"] or settings["on-middle-click"] or settings[
"on-scroll-up"] or settings["on-scroll-down"]:
self.connect('button-press-event', self.on_button_press)
self.connect('button-release-event', self.on_button_release)
self.add_events(Gdk.EventMask.SCROLL_MASK)
self.connect('scroll-event', self.on_scroll)

Expand Down Expand Up @@ -120,7 +120,7 @@ def on_leave_notify_event(self, widget, event):
widget.unset_state_flags(Gtk.StateFlags.DROP_ACTIVE)
widget.unset_state_flags(Gtk.StateFlags.SELECTED)

def on_button_press(self, widget, event):
def on_button_release(self, widget, event):
if event.button == 1 and self.settings["on-left-click"]:
self.launch(self.settings["on-left-click"])
elif event.button == 2 and self.settings["on-middle-click"]:
Expand Down

0 comments on commit d687bdb

Please sign in to comment.