From patchwork Wed Apr 2 12:32:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 336335 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 1C5421400FA for ; Wed, 2 Apr 2014 23:35:11 +1100 (EST) Received: from localhost ([::1]:38331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVKNo-00054v-4x for incoming@patchwork.ozlabs.org; Wed, 02 Apr 2014 08:35:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57350) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVKLa-0002Fd-C8 for qemu-devel@nongnu.org; Wed, 02 Apr 2014 08:32:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WVKLR-00078c-Lm for qemu-devel@nongnu.org; Wed, 02 Apr 2014 08:32:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56576 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WVKLR-00078E-Fb for qemu-devel@nongnu.org; Wed, 02 Apr 2014 08:32:41 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 00C10ACDE; Wed, 2 Apr 2014 12:32:41 +0000 (UTC) From: Takashi Iwai To: qemu-devel@nongnu.org Date: Wed, 2 Apr 2014 14:32:30 +0200 Message-Id: <1396441953-19260-2-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1396441953-19260-1-git-send-email-tiwai@suse.de> References: <1396441953-19260-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: kraxel@redhat.com, Anthony Liguori , Cole Robinson Subject: [Qemu-devel] [PATCH v2 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 Signed-off-by: Takashi Iwai Tested-by: Cole Robinson Reviewed-by: Cole Robinson --- ui/gtk.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index f056e4034b3e..54b835428a28 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -765,6 +765,13 @@ 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 +1274,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",