}
static void
-gdk_toplevel_default_unexport_handle (GdkToplevel *toplevel)
+gdk_toplevel_default_unexport_handle (GdkToplevel *toplevel,
+ const char *handle)
{
}
/*< private >
* gdk_toplevel_unexport_handle:
* @toplevel: a `GdkToplevel`
+ * @handle: the handle to unexport
*
* Destroys the handle that was obtained with [method@Gdk.Toplevel.export_handle].
*
* Since: 4.10
*/
void
-gdk_toplevel_unexport_handle (GdkToplevel *toplevel)
+gdk_toplevel_unexport_handle (GdkToplevel *toplevel,
+ const char *handle)
{
- GDK_TOPLEVEL_GET_IFACE (toplevel)->unexport_handle (toplevel);
+ GDK_TOPLEVEL_GET_IFACE (toplevel)->unexport_handle (toplevel, handle);
}
GAsyncResult *result,
GError **error);
- void (* unexport_handle) (GdkToplevel *toplevel);
+ void (* unexport_handle) (GdkToplevel *toplevel,
+ const char *handle);
};
typedef enum
GAsyncResult *result,
GError **error);
-void gdk_toplevel_unexport_handle (GdkToplevel *toplevel);
+void gdk_toplevel_unexport_handle (GdkToplevel *toplevel,
+ const char *handle);
G_END_DECLS
}
static void
-gdk_wayland_toplevel_real_unexport_handle (GdkToplevel *toplevel)
+gdk_wayland_toplevel_real_unexport_handle (GdkToplevel *toplevel,
+ const char *handle)
{
GdkWaylandToplevel *wayland_toplevel = GDK_WAYLAND_TOPLEVEL (toplevel);
void
gdk_wayland_toplevel_unexport_handle (GdkToplevel *toplevel)
{
- g_return_if_fail (GDK_IS_WAYLAND_TOPLEVEL (toplevel));
-
- gdk_toplevel_unexport_handle (toplevel);
+ g_warning ("Use gdk_wayland_toplevel_drop_exported_handle()");
}
/**
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);
+ gdk_toplevel_unexport_handle (toplevel, handle);
}
static void
}
static void
-gdk_x11_toplevel_unexport_handle (GdkToplevel *toplevel)
+gdk_x11_toplevel_unexport_handle (GdkToplevel *toplevel,
+ const char *handle)
{
}
return NULL;
}
+static const char *
+unprefix_handle (const char *handle)
+{
+ if (g_str_has_prefix (handle, "wayland:"))
+ return handle + strlen ("wayland:");
+ else if (g_str_has_prefix (handle, "x11:"))
+ return handle + strlen ("x1!:");
+ else
+ return handle;
+}
+
static void
export_handle_done (GObject *source,
GAsyncResult *result,
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- gdk_toplevel_unexport_handle (GDK_TOPLEVEL (priv->surface));
+ gdk_toplevel_unexport_handle (GDK_TOPLEVEL (priv->surface), unprefix_handle (handle));
}
static GtkPointerFocus *