From patchwork Thu Feb 13 11:15:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 320089 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 7FFE52C00BD for ; Fri, 14 Feb 2014 01:57:40 +1100 (EST) Received: from localhost ([::1]:46863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDxjN-0006qp-Jb for incoming@patchwork.ozlabs.org; Thu, 13 Feb 2014 09:57:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDuGo-0000K2-EA for qemu-devel@nongnu.org; Thu, 13 Feb 2014 06:16:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDuGh-0003FS-EU for qemu-devel@nongnu.org; Thu, 13 Feb 2014 06:15:54 -0500 Received: from cantor2.suse.de ([195.135.220.15]:53186 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDuGh-0003Es-5N for qemu-devel@nongnu.org; Thu, 13 Feb 2014 06:15:47 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E616CABEE; Thu, 13 Feb 2014 11:15:44 +0000 (UTC) From: Takashi Iwai To: qemu-devel@nongnu.org Date: Thu, 13 Feb 2014 12:15:36 +0100 Message-Id: <1392290139-17250-2-git-send-email-tiwai@suse.de> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1392290139-17250-1-git-send-email-tiwai@suse.de> References: <1392290139-17250-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 X-Mailman-Approved-At: Thu, 13 Feb 2014 09:54:02 -0500 Cc: Anthony Liguori Subject: [Qemu-devel] [PATCH 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 --- ui/gtk.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index a633d8934633..4d5ea8e6bb38 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -760,6 +760,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) @@ -1254,8 +1261,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",