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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2778>
This commit is contained in:
Florian Müllner 2023-05-27 15:00:43 +02:00 committed by Marge Bot
parent 1d1e2b2313
commit 62b4e67b38
2 changed files with 8 additions and 2 deletions

View File

@ -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
}

View File

@ -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);