[gtk+/touchscreens: 50/65] gtk: Only set widget under device on non-virtual crossing events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/touchscreens: 50/65] gtk: Only set widget under device on non-virtual crossing events
- Date: Tue, 13 Dec 2011 19:00:17 +0000 (UTC)
commit b8e6058299d3ecf596bad89f6c8fc6a1b6e5c1bc
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Dec 6 20:20:39 2011 +0100
gtk: Only set widget under device on non-virtual crossing events
_gtk_widget_set_device_window() is suppose to make accounting of
the topmost widget under the device at each time, so avoid setting
it on virtual crossing events as the device is already in another
window.
gtk/gtkmain.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index d4d1651..a65b5ab 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1719,18 +1719,22 @@ gtk_main_do_event (GdkEvent *event)
break;
case GDK_ENTER_NOTIFY:
- _gtk_widget_set_device_window (event_widget,
- gdk_event_get_device (event),
- event->any.window);
+ if (event->crossing.detail != GDK_NOTIFY_VIRTUAL &&
+ event->crossing.detail != GDK_NOTIFY_NONLINEAR_VIRTUAL)
+ _gtk_widget_set_device_window (event_widget,
+ gdk_event_get_device (event),
+ event->any.window);
if (gtk_widget_is_sensitive (grab_widget) &&
!gtk_propagate_captured_event (grab_widget, event, topmost_widget))
gtk_widget_event (grab_widget, event);
break;
case GDK_LEAVE_NOTIFY:
- _gtk_widget_set_device_window (event_widget,
- gdk_event_get_device (event),
- NULL);
+ if (event->crossing.detail != GDK_NOTIFY_VIRTUAL &&
+ event->crossing.detail != GDK_NOTIFY_NONLINEAR_VIRTUAL)
+ _gtk_widget_set_device_window (event_widget,
+ gdk_event_get_device (event),
+ NULL);
if (gtk_widget_is_sensitive (grab_widget) &&
!gtk_propagate_captured_event (grab_widget, event, topmost_widget))
gtk_widget_event (grab_widget, event);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]