ozone/wayland: tabdrag: Reliably deliver drop event
Depending on the Wayland compositor, there might be slight deviations in the order that wl_data_source and wl_pointer events arrive when DND sessions (with no data exchange) are about to finish, i.e: right after mouse button is released. Exosphere and recent versions of Gnome Shell, for example, send a wl_pointer::leave before wl_data_source::cancelled, which is the only reliable way for the drag controller to determine when to dispatch the drop event. This event must be sent and to guarantee it is delivered to the right upper layer UI objects, the correct window must have pointer focus at ozone/wayland level. To make the drag controller more resistant to such deviations, this patch adds a class variable that keeps track of the "pointer grab owner" during the session and does a little change in the Pointer::Delegate API so it is possible to target a specific window when dispatching a mouse button event. Also, a test case is added to exercise such scenario. R=tonikitoo@igalia.com --gtest_filter='*DragToOtherWindowSnapDragDrop*' Test: ozone_unittests --ozone-platform=wayland \ Bug: 896640 Change-Id: I67694be2c06f1663ca6f4090c47cb825e9ec150e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2281112 Commit-Queue: Nick Yamane <nickdiego@igalia.com> Reviewed-by:Antonio Gomes <tonikitoo@igalia.com> Cr-Commit-Position: refs/heads/master@{#785198}
Showing
Please register or sign in to comment