xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 8 11:20:01 UTC 2024


 hw/vfb/InitInput.c |   18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 5f48efa2bd8af7128e297e589e404825e6bed706
Author: Luke Dashjr <luke-jr+git at utopios.org>
Date:   Sat Nov 19 00:04:22 2022 +0000

    Xvfb: Support up to 13 mouse buttons
    
    Signed-off-by: Luke Dashjr <luke-jr+git at utopios.org>

diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 2c272fad5..21387dee4 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -81,7 +81,7 @@ vfbKeybdProc(DeviceIntPtr pDevice, int onoff)
 static int
 vfbMouseProc(DeviceIntPtr pDevice, int onoff)
 {
-#define NBUTTONS 3
+#define NBUTTONS 13
 #define NAXES 2
 
     BYTE map[NBUTTONS + 1];
@@ -91,13 +91,23 @@ vfbMouseProc(DeviceIntPtr pDevice, int onoff)
 
     switch (onoff) {
     case DEVICE_INIT:
-        map[1] = 1;
-        map[2] = 2;
-        map[3] = 3;
+        for (int i = 1; i <= NBUTTONS; ++i) {
+            map[i] = i;
+        }
 
         btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
         btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
         btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+        btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+        btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+        btn_labels[5] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_LEFT);
+        btn_labels[6] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_HWHEEL_RIGHT);
+        btn_labels[7] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
+        btn_labels[8] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
+        btn_labels[9] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
+        btn_labels[10] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
+        btn_labels[11] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
+        btn_labels[12] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_UNKNOWN);
 
         axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
         axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);


More information about the xorg-commit mailing list