Skip to content

Commit

Permalink
ui/gtk: Ignore 2- and 3-button press events
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
klange authored and kraxel committed Mar 18, 2022
1 parent 1d60bb4 commit 2297db8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/gtk.c
Expand Up @@ -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();
Expand Down

0 comments on commit 2297db8

Please sign in to comment.