diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-03-02 00:09:28 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-03-02 00:25:12 +0300 |
commit | 9bd586a01e6813a615eab05871803730603e2152 (patch) | |
tree | a437902dcc606b7ea3b13d6d7e7ba1168a6428bd /source/blender/windowmanager/intern/wm_event_system.c | |
parent | 8e88af99348590e9879dcbfe97bbbc180fc5ec67 (diff) |
Fix T95608: Mac issues with drag drop on multi-monitor
Mousemove events are sent to windows.
In Windows OS, almost all mousemove events are sent to the window whose
mouse cursor is over.
On MacOS, the window with mousemove events is always the active window.
It doesn't matter if the mouse cursor is inside or outside the window.
So, in order for non-active windows to also have events,
`WM_window_find_under_cursor` is called to find those windows and send
the same events.
The problem is that to find the window, `WM_window_find_under_cursor`
only has the mouse coordinates available, it doesn't differentiate
which monitor these coordinates came from.
So the mouse on one monitor may incorrectly send events to a window on
another monitor.
The solution used is to use a native API on Mac to detect the window
under the cursor.
For Windows and Linux nothing has changed.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D14197
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 0cc2db661ec..d9ef7dc63ff 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -4663,8 +4663,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi } } - wmWindow *win_other = WM_window_find_under_cursor(wm, win, win, mval, mval); - if (win_other) { + wmWindow *win_other = WM_window_find_under_cursor(win, mval, mval); + if (win_other && win_other != win) { copy_v2_v2_int(event->xy, mval); return win_other; } |