_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.
This commit is contained in:
Owen W. Taylor 2014-03-13 10:30:05 -04:00
parent c737045462
commit 2f43800aa3

View File

@ -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;