Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SwayNC module #200

Merged
merged 2 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nwg_panel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@ def main():
common.outputs = list_outputs(sway=sway, tree=tree, silent=True)
common.outputs_num = len(common.outputs)

Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 200, check_tree)
if sway:
Gdk.threads_add_timeout(GLib.PRIORITY_DEFAULT_IDLE, 200, check_tree)

if tray_available and len(common.tray_list) > 0:
sni_system_tray.init_tray(common.tray_list)
Expand Down
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