From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVMlk-0007Hh-FW for qemu-devel@nongnu.org; Wed, 02 Apr 2014 11:08:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVMle-0004Wg-CT for qemu-devel@nongnu.org; Wed, 02 Apr 2014 11:08:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVMle-0004WY-3g for qemu-devel@nongnu.org; Wed, 02 Apr 2014 11:07:54 -0400 From: Cole Robinson Date: Wed, 2 Apr 2014 11:07:44 -0400 Message-Id: <6654339de9ab8191d7a11ce68194b9cd27471d54.1396451183.git.crobinso@redhat.com> In-Reply-To: <1396449543.31715.7.camel@nilsson.home.kraxel.org> References: <1396449543.31715.7.camel@nilsson.home.kraxel.org> Subject: [Qemu-devel] [PATCH] gtk: Grab pointer on click when in relative mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: tiwai@suse.de, Gerd Hoffmann , Cole Robinson Without this, we need to initiate a manual grab with ctrl+alt+g just to get a usable mouse. Signed-off-by: Cole Robinson --- 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