wayland: Try harder to be compatible

We can keep the old unexport_handle api working
in the case that there is only a single exported
handle.
This commit is contained in:
Matthias Clasen 2023-05-14 19:14:58 -04:00
parent 250a5c0dfd
commit 89d993b6ec

View File

@ -2557,6 +2557,20 @@ gdk_wayland_toplevel_export_handle (GdkToplevel *toplevel,
void void
gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel) gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel)
{ {
GdkWaylandToplevel *wayland_toplevel = GDK_WAYLAND_TOPLEVEL (toplevel);
if (wayland_toplevel->exported != NULL &&
wayland_toplevel->exported->next == NULL)
{
GdkWaylandExported *exported = wayland_toplevel->exported->data;
if (exported->handle)
{
gdk_toplevel_unexport_handle (toplevel, exported->handle);
return;
}
}
g_warning ("Use gdk_wayland_toplevel_drop_exported_handle()"); g_warning ("Use gdk_wayland_toplevel_drop_exported_handle()");
} }