xwayland: Check MetaDndBridge focus_window when updating X11 proxy window

We are keeping accounting of the focus window as seen by the DnD bridge
right here, so use it instead of the MetaWaylandDragGrab focus as it may
lag behind the real focus (i.e. till the drag source notices the window
and sends XdndEnter to it).

This leads to the window trying to be repositioned more often than
necessary when the drag source takes long to send the XdndEnter client
message, and maybe not repositioned at all if the pointer leaves the
surface while no XdndEnter message was received.

https://bugzilla.gnome.org/show_bug.cgi?id=763246
This commit is contained in:
Carlos Garnacho 2017-03-08 13:49:16 +01:00
parent 21b2eff334
commit 572610d01e

View File

@ -1359,11 +1359,11 @@ repick_drop_surface (MetaWaylandCompositor *compositor,
MetaWaylandSurface *focus = NULL;
focus = pick_drop_surface (compositor, event);
dnd->focus_surface = focus;
if (meta_wayland_drag_grab_get_focus (drag_grab) == focus)
if (dnd->focus_surface == focus)
return;
dnd->focus_surface = focus;
if (focus &&
focus->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
{