summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-05-14 19:14:58 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-05-15 00:20:24 -0400
commit89d993b6ecb30c76df9b948b80444c871b20a253 (patch)
tree176c9695340dd33d1de06b4770db0a5fe6bec80c
parent250a5c0dfddf1660cdaf21b92e4cb1376a07932c (diff)
downloadgtk+-89d993b6ecb30c76df9b948b80444c871b20a253.tar.gz
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.
-rw-r--r--gdk/wayland/gdktoplevel-wayland.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c
index efeb857b21..efe9ef86ce 100644
--- a/gdk/wayland/gdktoplevel-wayland.c
+++ b/gdk/wayland/gdktoplevel-wayland.c
@@ -2557,6 +2557,20 @@ gdk_wayland_toplevel_export_handle (GdkToplevel *toplevel,
void
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()");
}