[Bf-blender-cvs] [bbf87c4f750] master: Fix T99737: Dropping files fails with Wayland
Campbell Barton
noreply at git.blender.org
Tue Jul 19 05:32:47 CEST 2022
Commit: bbf87c4f750992f47f514733e3a7d33573f5c860
Author: Campbell Barton
Date: Tue Jul 19 13:33:02 2022 +1000
Branches: master
https://developer.blender.org/rBbbf87c4f750992f47f514733e3a7d33573f5c860
Fix T99737: Dropping files fails with Wayland
Drop events ignored the cursor coordinates, under the assumption that
cursor motion events would also be sent to update the cursor location.
This depended on the behavior of the compositor, it failed for Sway
but worked for Gnome-shell & River.
Resolve by making use of the drop events cursor coordinates.
===================================================================
M source/blender/windowmanager/intern/wm_window.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 70640eda605..d2182f759e5 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1362,6 +1362,11 @@ static bool ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_pt
event.type = MOUSEMOVE;
event.val = KM_NOTHING;
copy_v2_v2_int(event.prev_xy, event.xy);
+
+ wm_cursor_position_from_ghost_screen_coords(win, &ddd->x, &ddd->y);
+ event.xy[0] = ddd->x;
+ event.xy[1] = ddd->y;
+
event.flag = 0;
/* No context change! C->wm->windrawable is drawable, or for area queues. */
More information about the Bf-blender-cvs
mailing list