[gtk/gtk-3-24: 1/3] gdk/wayland: Fix gdk_window_impl_wayland_finalize() warnings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 1/3] gdk/wayland: Fix gdk_window_impl_wayland_finalize() warnings
- Date: Fri, 24 Jan 2020 16:36:02 +0000 (UTC)
commit c9601f1567177f1552bcc25d279e2340deee01e1
Author: Olivier Fourdan <ofourdan redhat com>
Date: Thu Jan 23 14:14:39 2020 +0100
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]