[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode
From: |
Cole Robinson |
Subject: |
[Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode |
Date: |
Wed, 2 Apr 2014 11:07:44 -0400 |
Without this, we need to initiate a manual grab with ctrl+alt+g just
to get a usable mouse.
Signed-off-by: Cole Robinson <address@hidden>
---
Gerd, Takashi, I think this should do what we want.
ui/gtk.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/ui/gtk.c b/ui/gtk.c
index 9b8df12..ebaade2 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -685,6 +685,15 @@ static gboolean gd_button_event(GtkWidget *widget,
GdkEventButton *button,
GtkDisplayState *s = opaque;
InputButton btn;
+ if (button->button == 1 &&
+ button->type == GDK_BUTTON_PRESS &&
+ !gd_is_grab_active(s) &&
+ !qemu_input_is_absolute()) {
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(s->grab_item),
+ TRUE);
+ return TRUE;
+ }
+
if (button->button == 1) {
btn = INPUT_BUTTON_LEFT;
} else if (button->button == 2) {
--
1.9.0
- [Qemu-devel] [PATCH v2 0/4] Fix relative pointer tracking on Gtk UI (v2), Takashi Iwai, 2014/04/02
- [Qemu-devel] [PATCH v2 4/4] gtk: Add "Grab On Click" option, Takashi Iwai, 2014/04/02
- Re: [Qemu-devel] [PATCH v2 4/4] gtk: Add "Grab On Click" option, Cole Robinson, 2014/04/02
- Re: [Qemu-devel] [PATCH v2 4/4] gtk: Add "Grab On Click" option, Gerd Hoffmann, 2014/04/02
- [Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode,
Cole Robinson <=
- Re: [Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode, Gerd Hoffmann, 2014/04/02
- Re: [Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode, Takashi Iwai, 2014/04/02
- Re: [Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode, Cole Robinson, 2014/04/02
- Re: [Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode, Takashi Iwai, 2014/04/03
[Qemu-devel] [PATCH v2 1/4] gtk: Use gtk generic event signal instead of motion-notify-event, Takashi Iwai, 2014/04/02
[Qemu-devel] [PATCH v2 3/4] gtk: Remember the last grabbed pointer position, Takashi Iwai, 2014/04/02