wayland: Add new backend api
authorMatthias Clasen <mclasen@redhat.com>
Sun, 14 May 2023 21:27:12 +0000 (17:27 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 15 May 2023 03:49:44 +0000 (23:49 -0400)
Add an alternative to unexport_handle that
does take the handle.

gdk/wayland/gdktoplevel-wayland.c
gdk/wayland/gdkwaylandtoplevel.h

index a73c3de695f30db4b24e7c13c14b00b2204d3f02..521841ee9dc25462568b0a21217dab8505ff7a62 100644 (file)
@@ -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)
 {
index 36410b30540be850889e98e3b750c3a39cbb3f04..bb7abe597620485ea1e23722f8db5b24c3f8ce8e 100644 (file)
@@ -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);