diff options
author | Joan Bruguera | 2021-09-27 22:36:32 +0200 |
---|---|---|
committer | Joan Bruguera | 2021-09-27 22:36:32 +0200 |
commit | 094ac4878fe52ae7e218675af877f8037f6a9186 (patch) | |
tree | 5d1ca53fde28165ca3bd1eaa9b04c030eee36e66 | |
parent | 27868d9b7cdfa8e9bd39f12c426432e60439a9e0 (diff) | |
download | aur-094ac4878fe52ae7e218675af877f8037f6a9186.tar.gz |
Sort out button number and names mixup
As far as I can tell by documentation (it's a mess!) and testing on my system:
* button 8 = BTN_SIDE = the button that makes Firefox go back
* button 9 = BTN_EXTRA = the button that makes Firefox go forward
However, in the original patches by Kevin it's interpreted like button 8 is
forward and button 9 is back, however the meaning is inverted in both the
spice-gtk and spice-vdagent changes so everything works at the end.
Clean it up to avoid confusion. Also use the SIDE and EXTRA terminology
everywhere since that's what's in spice-protocol for now.
-rw-r--r-- | spice-extra-mouse-buttons.patch | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spice-extra-mouse-buttons.patch b/spice-extra-mouse-buttons.patch index 64709b37d252..727253e360c3 100644 --- a/spice-extra-mouse-buttons.patch +++ b/spice-extra-mouse-buttons.patch @@ -7,8 +7,8 @@ These buttons are not mapped by GTK (`/usr/include/gtk-3.0/gdk/gdktypes.h`) but still exposed, so I hardcoded their values: - #define _GTK_BUTTON_PREV_MASK (1 << 15) /* button 9 */ - #define _GTK_BUTTON_NEXT_MASK (1 << 16) /* button 8 */ + #define _GTK_BUTTON_SIDE_MASK (1 << 15) /* button 8 */ + #define _GTK_BUTTON_EXTRA_MASK (1 << 16) /* button 9 */ Co-Authored-By: Joan Bruguera <joanbrugueram@gmail.com> --- @@ -56,8 +56,8 @@ index 5cef966b..85d0f4db 100644 [ 5 ] = SPICE_MOUSE_BUTTON_DOWN, + [ 6 ] = 0, + [ 7 ] = 0, -+ [ 8 ] = SPICE_MOUSE_BUTTON_EXTRA, -+ [ 9 ] = SPICE_MOUSE_BUTTON_SIDE, ++ [ 8 ] = SPICE_MOUSE_BUTTON_SIDE, ++ [ 9 ] = SPICE_MOUSE_BUTTON_EXTRA, }; if (gdk < SPICE_N_ELEMENTS(map)) { @@ -67,8 +67,8 @@ index 5cef966b..85d0f4db 100644 [3] = SPICE_MOUSE_BUTTON_MASK_RIGHT, + [6] = 0, + [7] = 0, -+ [8] = SPICE_MOUSE_BUTTON_EXTRA, -+ [9] = SPICE_MOUSE_BUTTON_SIDE, ++ [8] = SPICE_MOUSE_BUTTON_SIDE, ++ [9] = SPICE_MOUSE_BUTTON_EXTRA, }; if (gdk < SPICE_N_ELEMENTS(map)) { @@ -77,12 +77,12 @@ index 5cef966b..85d0f4db 100644 if (gdk & GDK_BUTTON3_MASK) spice |= SPICE_MOUSE_BUTTON_MASK_RIGHT; + /* Mouse buttons above 5 are not defined by GDK */ -+#define _GTK_BUTTON_PREV_MASK (1 << 15) /* button 9 */ -+#define _GTK_BUTTON_NEXT_MASK (1 << 16) /* button 8 */ -+ if (gdk & _GTK_BUTTON_PREV_MASK) -+ spice |= SPICE_MOUSE_BUTTON_MASK_EXTRA; -+ if (gdk & _GTK_BUTTON_NEXT_MASK) ++#define _GTK_BUTTON_SIDE_MASK (1 << 15) /* button 8 */ ++#define _GTK_BUTTON_EXTRA_MASK (1 << 16) /* button 9 */ ++ if (gdk & _GTK_BUTTON_SIDE_MASK) + spice |= SPICE_MOUSE_BUTTON_MASK_SIDE; ++ if (gdk & _GTK_BUTTON_EXTRA_MASK) ++ spice |= SPICE_MOUSE_BUTTON_MASK_EXTRA; + return spice; } |