Set active physical device when using the mouse

This commit is contained in:
Luca Bacci 2021-07-05 16:13:59 +02:00
parent a32973f56b
commit fe280e578f
No known key found for this signature in database
GPG Key ID: 8E3C8D989C98883D

View File

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