[gtk+/xi2: 1170/1239] GdkDisplay: Do not mix device types when checking grab ownership.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/xi2: 1170/1239] GdkDisplay: Do not mix device types when checking grab ownership.
- Date: Tue, 29 Sep 2009 10:57:19 +0000 (UTC)
commit 7ae3845fed357eb000002dfbbac92ee32f530091
Author: Carlos Garnacho <carlos gnome org>
Date: Wed Sep 16 14:01:24 2009 +0200
GdkDisplay: Do not mix device types when checking grab ownership.
gdk/gdkdisplay.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 6b8b3de..90f143e 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -1490,9 +1490,11 @@ _gdk_display_check_grab_ownership (GdkDisplay *display,
GHashTableIter iter;
gpointer key, value;
GdkGrabOwnership higher_ownership, device_ownership;
+ gboolean device_is_keyboard;
g_hash_table_iter_init (&iter, display->device_grabs);
higher_ownership = device_ownership = GDK_OWNERSHIP_NONE;
+ device_is_keyboard = (device->source == GDK_SOURCE_KEYBOARD);
while (g_hash_table_iter_next (&iter, &key, &value))
{
@@ -1507,6 +1509,11 @@ _gdk_display_check_grab_ownership (GdkDisplay *display,
if (!grabs)
continue;
+ /* Discard device if it's not of the same type */
+ if ((device_is_keyboard && dev->source != GDK_SOURCE_KEYBOARD) ||
+ (!device_is_keyboard && dev->source == GDK_SOURCE_KEYBOARD))
+ continue;
+
grab = grabs->data;
if (dev == device)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]