From c9601f1567177f1552bcc25d279e2340deee01e1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 23 Jan 2020 14:14:39 +0100 Subject: [PATCH] gdk/wayland: Fix gdk_window_impl_wayland_finalize() warnings On Wayland, opening and closing a `GdkDisplay` generates a coupe of warnings at runtime: ``` GLib-GObject-WARNING **: invalid cast from 'GdkWindowImplWayland' to 'GdkWindow' GLib-GObject-WARNING **: invalid cast from 'GdkWaylandWindow' to 'GdkWindowImplWayland' ``` This is from `gdk_window_impl_wayland_finalize()` which tries to cast the given GObject to a `GdkWindow` while it's a `GdkWindowImplWayland`. Use the correct type casting of objects to avoid the warnings. --- gdk/wayland/gdkwindow-wayland.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index b5d427ce31..c699025027 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -992,15 +992,14 @@ gdk_window_impl_wayland_beep (GdkWindow *window) static void gdk_window_impl_wayland_finalize (GObject *object) { - GdkWindow *window = GDK_WINDOW (object); GdkWindowImplWayland *impl; g_return_if_fail (GDK_IS_WINDOW_IMPL_WAYLAND (object)); impl = GDK_WINDOW_IMPL_WAYLAND (object); - if (gdk_wayland_window_is_exported (window)) - gdk_wayland_window_unexport_handle (window); + if (gdk_wayland_window_is_exported (impl->wrapper)) + gdk_wayland_window_unexport_handle (impl->wrapper); g_free (impl->title);