]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
ui/gtk: Ignore 2- and 3-button press events
authorK. Lange <klange@toaruos.org>
Sat, 5 Mar 2022 10:45:21 +0000 (19:45 +0900)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 18 Mar 2022 08:27:33 +0000 (09:27 +0100)
GTK already produces corresponding GDK_BUTTON_PRESS events
alongside 2BUTTON and 3BUTTON_PRESS events. The 2BUTTON and
3BUTTON_PRESS events were incorrectly being interpreted and
passed to guests as button release events.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/558
Signed-off-by: K. Lange <klange@toaruos.org>
Message-Id: <20220305104521.3583703-1-klange@toaruos.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/gtk.c

index 1b24a67d79640d1deeb644222ccda8b86ac776df..c57c36749e0eb2f3ddb567412e553f5ee3477e36 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -972,6 +972,10 @@ static gboolean gd_button_event(GtkWidget *widget, GdkEventButton *button,
         return TRUE;
     }
 
+    if (button->type == GDK_2BUTTON_PRESS || button->type == GDK_3BUTTON_PRESS) {
+        return TRUE;
+    }
+
     qemu_input_queue_btn(vc->gfx.dcl.con, btn,
                          button->type == GDK_BUTTON_PRESS);
     qemu_input_event_sync();