[gtk: 4/19] Set active physical device when using the mouse




commit fe280e578f6b9da2096bb8f625a2b441712066c3
Author: Luca Bacci <luca bacci982 gmail com>
Date:   Mon Jul 5 16:13:59 2021 +0200

    Set active physical device when using the mouse

 gdk/win32/gdkevents-win32.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index bd969e3338..d0bcdff8d6 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -55,6 +55,7 @@
 #include "gdkdevicemanager-win32.h"
 #include "gdkdisplay-win32.h"
 #include "gdkdeviceprivate.h"
+#include "gdkdevice-virtual.h"
 #include "gdkdevice-wintab.h"
 #include "gdkwin32dnd.h"
 #include "gdkwin32dnd-private.h"
@@ -1068,6 +1069,8 @@ send_crossing_event (GdkDisplay                 *display,
   pt = *screen_pt;
   ScreenToClient (GDK_SURFACE_HWND (window), &pt);
 
+  _gdk_device_virtual_set_active (_gdk_device_manager->core_pointer, physical_device);
+
   event = gdk_crossing_event_new (type,
                                   window,
                                   device_manager->core_pointer,
@@ -1532,6 +1535,9 @@ generate_button_event (GdkEventType      type,
   current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale;
   current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale;
 
+  _gdk_device_virtual_set_active (_gdk_device_manager->core_pointer,
+                                  _gdk_device_manager->system_pointer);
+
   event = gdk_button_event_new (type,
                                 window,
                                 device_manager->core_pointer,
@@ -2359,6 +2365,9 @@ gdk_event_translate (MSG *msg,
          current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale;
          current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale;
 
+          _gdk_device_virtual_set_active (_gdk_device_manager->core_pointer,
+                                          _gdk_device_manager->system_pointer);
+
          event = gdk_motion_event_new (window,
                                        device_manager_win32->core_pointer,
                                         NULL,
@@ -2485,6 +2494,9 @@ gdk_event_translate (MSG *msg,
        */
       delta_y *= -1.0;
 
+      _gdk_device_virtual_set_active (_gdk_device_manager->core_pointer,
+                                      _gdk_device_manager->system_pointer);
+
       event = gdk_scroll_event_new (window,
                                     device_manager_win32->core_pointer,
                                     NULL,


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