summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-05-14 17:27:12 -0400
committerMatthias Clasen <mclasen@redhat.com>2023-05-14 23:49:44 -0400
commitbf87a40b203d6ed6c902aeb169bbcf081c65ff60 (patch)
tree0a17bb8044d65fdea30c29b93a0dd10778cc25e8
parent4c6919283763280df0ede9940ebf30afb794f079 (diff)
downloadgtk+-bf87a40b203d6ed6c902aeb169bbcf081c65ff60.tar.gz
wayland: Add new backend api
Add an alternative to unexport_handle that does take the handle.
-rw-r--r--gdk/wayland/gdktoplevel-wayland.c21
-rw-r--r--gdk/wayland/gdkwaylandtoplevel.h4
2 files changed, 25 insertions, 0 deletions
diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c
index a73c3de695..521841ee9d 100644
--- a/gdk/wayland/gdktoplevel-wayland.c
+++ b/gdk/wayland/gdktoplevel-wayland.c
@@ -2491,6 +2491,27 @@ gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel)
gdk_toplevel_unexport_handle (toplevel);
}
+/**
+ * gdk_wayland_toplevel_drop_exported_handle:
+ * @toplevel: (type GdkWaylandToplevel): the `GdkToplevel` that was exported
+ * @handle: the handle to drop
+ *
+ * Destroy a handle that was obtained with gdk_wayland_toplevel_export_handle().
+ *
+ * Note that this API depends on an unstable Wayland protocol,
+ * and thus may require changes in the future.
+ *
+ * Since: 4.12
+ */
+void
+gdk_wayland_toplevel_drop_exported_handle (GdkToplevel *toplevel,
+ const char *handle)
+{
+ g_return_if_fail (GDK_IS_WAYLAND_TOPLEVEL (toplevel));
+
+ gdk_toplevel_unexport_handle (toplevel);
+}
+
static void
unset_transient_for_exported (GdkWaylandToplevel *toplevel)
{
diff --git a/gdk/wayland/gdkwaylandtoplevel.h b/gdk/wayland/gdkwaylandtoplevel.h
index 36410b3054..bb7abe5976 100644
--- a/gdk/wayland/gdkwaylandtoplevel.h
+++ b/gdk/wayland/gdkwaylandtoplevel.h
@@ -55,6 +55,10 @@ gboolean gdk_wayland_toplevel_export_handle (GdkToplevel
GDK_AVAILABLE_IN_ALL
void gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel);
+GDK_AVAILABLE_IN_4_12
+void gdk_wayland_toplevel_drop_exported_handle (GdkToplevel *toplevel,
+ const char *handle);
+
GDK_AVAILABLE_IN_ALL
gboolean gdk_wayland_toplevel_set_transient_for_exported (GdkToplevel *toplevel,
const char *parent_handle_str);