Skip to content

Commit

Permalink
Fix side buttons on Win32
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed May 19, 2023
1 parent 0aeece9 commit 034df57
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1672,14 +1672,24 @@ def remove_pointer_overlay():
x, y, w, h = abs_coords(*prev[2:5])
self.repaint(x, y, w, h)

def _button_resolve(self, button):
if WIN32 and button in (4, 5):
# On Windows "X" buttons (the extra buttons sometimes found on the
# side of the mouse) are numbered 4 and 5, as there is a different
# API for scroll events. Convert them into the X11 convention of 8
# and 9.
return button + 4
return button

def _do_button_press_event(self, event):
#Gtk.Window.do_button_press_event(self, event)
self._button_action(event.button, event, True)
button = self._button_resolve(event.button)
self._button_action(button, event, True)

def _do_button_release_event(self, event):
#Gtk.Window.do_button_release_event(self, event)
self._button_action(event.button, event, False)
button = self._button_resolve(event.button)
self._button_action(button, event, False)

######################################################################
# pointer motion
Expand Down

0 comments on commit 034df57

Please sign in to comment.