diff options
author | Matthias Clasen <mclasen@redhat.com> | 2023-05-14 17:28:17 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-05-14 23:49:44 -0400 |
commit | e5f1e4545d22a75518c7be54e20ecdda19273c4e (patch) | |
tree | b4eb13809403fbfb33002ff508ade17f2ffc8f9f /gtk | |
parent | bf87a40b203d6ed6c902aeb169bbcf081c65ff60 (diff) | |
download | gtk+-e5f1e4545d22a75518c7be54e20ecdda19273c4e.tar.gz |
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.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkwindow.c | 13 |
1 files changed, 12 insertions, 1 deletions
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 * |