[gtk/gtk-3-24: 1/3] Wintab: set the right device field in the event structure




commit af747315d79331b33b3967f39103d73b471ec658
Author: Luca Bacci <luca bacci982 gmail com>
Date:   Mon Jun 7 11:18:07 2021 +0200

    Wintab: set the right device field in the event structure
    
    Even when sends_core is FALSE
    
    Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3860

 gdk/win32/gdkdevicemanager-win32.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gdk/win32/gdkdevicemanager-win32.c b/gdk/win32/gdkdevicemanager-win32.c
index 34c0083cb3..b91d089d49 100644
--- a/gdk/win32/gdkdevicemanager-win32.c
+++ b/gdk/win32/gdkdevicemanager-win32.c
@@ -1279,6 +1279,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS;
           event->button.time = _gdk_win32_get_next_tick (msg->time);
          if (source_device->sends_core)
            gdk_event_set_device (event, device_manager->core_pointer);
+          else
+            gdk_event_set_device (event, GDK_DEVICE (source_device));
           gdk_event_set_source_device (event, GDK_DEVICE (source_device));
           gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
 
@@ -1311,7 +1313,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS;
         {
           event->motion.time = _gdk_win32_get_next_tick (msg->time);
           event->motion.is_hint = FALSE;
-          gdk_event_set_device (event, device_manager->core_pointer);
+          if (source_device->sends_core)
+            gdk_event_set_device (event, device_manager->core_pointer);
+          else
+            gdk_event_set_device (event, GDK_DEVICE (source_device));
           gdk_event_set_source_device (event, GDK_DEVICE (source_device));
           gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
 


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