summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoan Bruguera2021-09-27 23:04:22 +0200
committerJoan Bruguera2021-09-27 23:04:22 +0200
commit7e22edff5786f8e0542e1b7fa5ba765daca36b8a (patch)
tree8ac03bae50b4b0e45a6f055a7f05724f5156b98a
parent47e718806fc45b854f72a3cdd7bb6af923741bb8 (diff)
downloadaur-7e22edff5786f8e0542e1b7fa5ba765daca36b8a.tar.gz
Remove 'hack' for button masks
Document the situation better and remove those hacks to have a better patch. Since the masks don't even work on X11 I don't think anyone cares.
-rw-r--r--spice-extra-mouse-buttons.patch29
1 files changed, 10 insertions, 19 deletions
diff --git a/spice-extra-mouse-buttons.patch b/spice-extra-mouse-buttons.patch
index ae9d604dfa49..c4b2cc660742 100644
--- a/spice-extra-mouse-buttons.patch
+++ b/spice-extra-mouse-buttons.patch
@@ -3,17 +3,10 @@ From: Kevin Pouget <kpouget@redhat.com>
Date: Thu, 14 May 2020 16:00:59 +0200
Subject: [PATCH] Capture and forward mouse buttons 8 and 9
-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_SIDE_MASK (1 << 15) /* button 8 */
- #define _GTK_BUTTON_EXTRA_MASK (1 << 16) /* button 9 */
-
Co-Authored-By: Joan Bruguera <joanbrugueram@gmail.com>
---
src/channel-inputs.c | 12 ++++++++++++
- src/spice-widget.c | 12 ++++++++++++
+ src/spice-widget.c | 10 ++++++++++
2 files changed, 28 insertions(+)
diff --git a/src/channel-inputs.c b/src/channel-inputs.c
@@ -63,23 +56,21 @@ index 5cef966b..85d0f4db 100644
[1] = SPICE_MOUSE_BUTTON_MASK_LEFT,
[2] = SPICE_MOUSE_BUTTON_MASK_MIDDLE,
[3] = SPICE_MOUSE_BUTTON_MASK_RIGHT,
-+ [8] = SPICE_MOUSE_BUTTON_MASK_SIDE,
-+ [9] = SPICE_MOUSE_BUTTON_MASK_EXTRA,
++ [8] = 0, /* See below: GDK does not define masks for SIDE/EXTRA buttons */
++ [9] = 0, /* Ditto */
};
if (gdk < SPICE_N_ELEMENTS(map)) {
-@@ -2029,6 +2037,14 @@ static int button_mask_gdk_to_spice(int gdk)
+@@ -2029,6 +2037,12 @@ static int button_mask_gdk_to_spice(int gdk)
spice |= SPICE_MOUSE_BUTTON_MASK_MIDDLE;
if (gdk & GDK_BUTTON3_MASK)
spice |= SPICE_MOUSE_BUTTON_MASK_RIGHT;
-+ /* Mouse buttons above 5 are not defined by GDK */
-+#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;
-+
++ /* Currently, GDK does not define any mask for buttons 8 and 9
++ For X11, no mask is set at all for those buttons:
++ https://gitlab.gnome.org/GNOME/gtk/-/blob/4fff68355a22027791258b900f1f39ca1226b669/gdk/x11/gdkdevice-xi2.c#L639
++ For Wayland, masks of (1 << 15) and (1 << 16) respectively are set:
++ https://gitlab.gnome.org/GNOME/gtk/-/blob/4fff68355a22027791258b900f1f39ca1226b669/gdk/wayland/gdkdevice-wayland.c#L1703
++ While the situation is unclear, completely ignore the mask for SIDE and EXTRA events */
return spice;
}