From patchwork Fri Apr 4 10:41:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 336916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id E4487140088 for ; Fri, 4 Apr 2014 21:42:53 +1100 (EST) Received: from localhost ([::1]:48947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW1aF-0007vF-Rg for incoming@patchwork.ozlabs.org; Fri, 04 Apr 2014 06:42:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW1ZN-0007Mn-Oq for qemu-devel@nongnu.org; Fri, 04 Apr 2014 06:42:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WW1Z9-0000qv-D9 for qemu-devel@nongnu.org; Fri, 04 Apr 2014 06:41:57 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47864 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW1Z9-0000qP-5r for qemu-devel@nongnu.org; Fri, 04 Apr 2014 06:41:43 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1D3D7ABE4; Fri, 4 Apr 2014 10:41:40 +0000 (UTC) From: Takashi Iwai To: qemu-devel@nongnu.org Date: Fri, 4 Apr 2014 12:41:21 +0200 Message-Id: <1396608084-26986-2-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1396608084-26986-1-git-send-email-tiwai@suse.de> References: <1396608084-26986-1-git-send-email-tiwai@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.135.220.15 Cc: Gerd Hoffmann , Anthony Liguori , Cole Robinson Subject: [Qemu-devel] [PATCH v3 1/4] gtk: Use gtk generic event signal instead of motion-notify-event X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The GDK motion-notify-event isn't generated when the pointer goes out of the target window even if the pointer is grabbed, which essentially means to lose the pointer tracking in gtk-ui. Meanwhile the generic "event" signal is sent when the pointer is grabbed, so we can use this and pick the motion notify events manually there instead. Reference: https://bugzilla.novell.com/show_bug.cgi?id=849587 Tested-by: Cole Robinson Reviewed-by: Cole Robinson Signed-off-by: Takashi Iwai --- ui/gtk.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index f056e4034b3e..c9f6d24eeb1a 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -765,6 +765,14 @@ static gboolean gd_key_event(GtkWidget *widget, GdkEventKey *key, void *opaque) return TRUE; } +static gboolean gd_event(GtkWidget *widget, GdkEvent *event, void *opaque) +{ + if (event->type == GDK_MOTION_NOTIFY) { + return gd_motion_event(widget, &event->motion, opaque); + } + return FALSE; +} + /** Window Menu Actions **/ static void gd_menu_pause(GtkMenuItem *item, void *opaque) @@ -1267,8 +1275,8 @@ static void gd_connect_signals(GtkDisplayState *s) g_signal_connect(s->drawing_area, "expose-event", G_CALLBACK(gd_expose_event), s); #endif - g_signal_connect(s->drawing_area, "motion-notify-event", - G_CALLBACK(gd_motion_event), s); + g_signal_connect(s->drawing_area, "event", + G_CALLBACK(gd_event), s); g_signal_connect(s->drawing_area, "button-press-event", G_CALLBACK(gd_button_event), s); g_signal_connect(s->drawing_area, "button-release-event",