summary refs log tree commit diff stats
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorK. Lange <klange@toaruos.org>2022-03-05 19:45:21 +0900
committerGerd Hoffmann <kraxel@redhat.com>2022-03-18 09:27:33 +0100
commit2297db8228cc0ee601a21b3e3f443ab6879f2a06 (patch)
tree27e580de38440f830c7edfb97e52ce835a0f95f6 /ui/gtk.c
parent1d60bb4b14601e38ed17384277aa4c30c57925d3 (diff)
downloadfocaccia-qemu-2297db8228cc0ee601a21b3e3f443ab6879f2a06.tar.gz
focaccia-qemu-2297db8228cc0ee601a21b3e3f443ab6879f2a06.zip
ui/gtk: Ignore 2- and 3-button press events
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>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index 1b24a67d79..c57c36749e 100644
--- 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();