From e5f1e4545d22a75518c7be54e20ecdda19273c4e Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 14 May 2023 17:28:17 -0400 Subject: gdk: Change the private export handle api Make unexport_handle take the handle, so we can in the future deal with multiple exports. Update the one caller in gtkwindow.c to pass the handle. --- gtk/gtkwindow.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gtk') diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 97f97ab5c9..4b67f2793b 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -6291,6 +6291,17 @@ prefix_handle (GdkDisplay *display, 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, @@ -6341,7 +6352,7 @@ gtk_window_unexport_handle (GtkWindow *window, { 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 * -- cgit v1.2.1