[gtk/matthiasc/win-pointer-doc-fix: 4/12] Set active physical device when using the mouse
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/win-pointer-doc-fix: 4/12] Set active physical device when using the mouse
- Date: Fri, 16 Jul 2021 12:28:58 +0000 (UTC)
commit 2e42216e44a6aea14a1ace2c500ba142f15701c0
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 | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index f047340616..c638e102c3 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"
@@ -1067,6 +1068,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,
@@ -1531,6 +1534,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,
@@ -2358,6 +2364,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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]