From 9203db0655125347040dc3193e7353d1e945e21e Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 6 Oct 2014 14:31:16 -0700 Subject: [PATCH] pointer: Don't fizzle out surface changes too soon During a DND grab, pointer->focus_surface is NULL, since the wl_pointer doesn't have any focused surface (it's in drag mode). In this case, the drag interface has control of the focus, and when dragging into a NULL surface, drag_grab_focus won't get called, properly detaching it from the previous surface. Let the interface->focus implementation do the fizzling out. In the future, we should split out wl_pointer's implementation (pointer->focus_surface) from the Wayland side of the generic pointer wrapper (pointer->current) and use our event routing system to determine or similar whether it should go to wl_pointer or wl_data_device. --- src/wayland/meta-wayland-pointer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 3fc05ecb7..a38a35fdc 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -272,11 +272,8 @@ sync_focus_surface (MetaWaylandPointer *pointer) g_assert_not_reached (); } - if (focus_surface != pointer->focus_surface) - { - const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; - interface->focus (pointer->grab, focus_surface); - } + const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; + interface->focus (pointer->grab, focus_surface); } static void