[gtk+] gdkwindow: don't use last_slave for the source device if it is NULL



commit 8568d66a7338f4678d4c3d6cde00e2870c8f38ee
Author: Thomas Wood <thomas wood intel com>
Date:   Thu Feb 7 11:59:31 2013 +0000

    gdkwindow: don't use last_slave for the source device if it is NULL
    
    Some backends do not have slave devices, which means last_slave may be
    NULL. Use the current device as the source device if last_slave is NULL
    when synthesizing a crossing event.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=692411

 gdk/gdkwindow.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index b6d4e09..0bc984d 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -9164,10 +9164,17 @@ do_synthesize_crossing_event (gpointer data)
                                 serial);
           if (new_window_under_pointer != pointer_info->window_under_pointer)
             {
+              GdkDevice *source_device;
+
+              if (pointer_info->last_slave)
+                source_device = pointer_info->last_slave;
+              else
+                source_device = device;
+
               _gdk_synthesize_crossing_events (display,
                                                pointer_info->window_under_pointer,
                                                new_window_under_pointer,
-                                               device, pointer_info->last_slave,
+                                               device, source_device,
                                                GDK_CROSSING_NORMAL,
                                                pointer_info->toplevel_x,
                                                pointer_info->toplevel_y,


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