[gtk+] _gtk_widget_get_device_window: Fix for keyboard devices



commit 2f43800aa3daabd0de1fd527fcc6a40127942a28
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Mar 13 10:30:05 2014 -0400

    _gtk_widget_get_device_window: Fix for keyboard devices
    
    Avoid a warning by returning NULL for keyboard devices, which can
    never have an active pointer for a widget.

 gtk/gtkwidget.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 5488c66..1d91ab0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11801,6 +11801,9 @@ _gtk_widget_get_device_window (GtkWidget *widget,
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
   g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
 
+  if (gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
+    return NULL;
+
   window = gdk_device_get_last_event_window (device);
   if (window && is_my_window (widget, window))
     return window;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]