From 62b4e67b38043d91e23379ca6a3f1bd24c0270fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 27 May 2023 15:00:43 +0200 Subject: [PATCH] subprojects/shew: Adjust to GTK deprecation GTK 4.12 deprecates gdk_wayland_toplevel_unexport_handle() in favor of the new gdk_wayland_toplevel_drop_exported_handle(). We are not bound by API stability, so we can just expose the additional argument that the replacement requires instead of tracking the handle internally. Part-of: --- subprojects/shew/src/shew-window-exporter.c | 7 ++++++- subprojects/shew/src/shew-window-exporter.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/subprojects/shew/src/shew-window-exporter.c b/subprojects/shew/src/shew-window-exporter.c index ab84bf8a9..0e338dc2d 100644 --- a/subprojects/shew/src/shew-window-exporter.c +++ b/subprojects/shew/src/shew-window-exporter.c @@ -126,7 +126,8 @@ shew_window_exporter_export_finish (ShewWindowExporter *exporter, } void -shew_window_exporter_unexport (ShewWindowExporter *exporter) +shew_window_exporter_unexport (ShewWindowExporter *exporter, + const char *handle) { GtkWidget *widget; @@ -138,7 +139,11 @@ shew_window_exporter_unexport (ShewWindowExporter *exporter) if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (widget))) { GdkSurface *s = gtk_native_get_surface (GTK_NATIVE (widget)); +#if GTK_CHECK_VERSION (4, 11, 3) + gdk_wayland_toplevel_drop_exported_handle (GDK_WAYLAND_TOPLEVEL (s), handle); +#else gdk_wayland_toplevel_unexport_handle (GDK_WAYLAND_TOPLEVEL (s)); +#endif } #endif } diff --git a/subprojects/shew/src/shew-window-exporter.h b/subprojects/shew/src/shew-window-exporter.h index 224fff52f..e449fa3be 100644 --- a/subprojects/shew/src/shew-window-exporter.h +++ b/subprojects/shew/src/shew-window-exporter.h @@ -35,4 +35,5 @@ char *shew_window_exporter_export_finish (ShewWindowExporter *exporter, GAsyncResult *result, GError **error); -void shew_window_exporter_unexport (ShewWindowExporter *exporter); +void shew_window_exporter_unexport (ShewWindowExporter *exporter, + const char *handle);