x11 drag: Fix mapped error

In the gtk-demo drag-and-drop demo i can't drag anything, all I get
is:

(gtk4-demo:358993): Gdk-CRITICAL **: 09:36:19.617: Surface 0x7e1bb0 has not been mapped in GdkSeatGrabPrepareFunc

This is because GdkX11Drag.ipc_surface is not considered mapped, even
though we called gdk_x11_surface_show() on it, because the
GDK_SURFACE_STATE_WITHDRAWN flag is still set.

I added calls to gdk_synthesize_surface_state() to match what
e.g. show_popup() and gdk_x11_toplevel_present() does.
This commit is contained in:
Alexander Larsson 2020-05-14 09:42:53 +02:00
parent 64db8be7d5
commit e702d42597

View File

@ -2028,6 +2028,8 @@ _gdk_x11_surface_drag_begin (GdkSurface *surface,
x11_drag->ipc_surface = ipc_surface;
if (gdk_x11_surface_get_group (surface))
gdk_x11_surface_set_group (x11_drag->ipc_surface, surface);
gdk_synthesize_surface_state (x11_drag->ipc_surface, GDK_SURFACE_STATE_WITHDRAWN, 0);
gdk_x11_surface_show (x11_drag->ipc_surface, FALSE);
x11_drag->drag_surface = create_drag_surface (display);