From b8c13cc426314048aa2cefb3ed082f798683dd33 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 15 Aug 2014 12:37:15 -0400 Subject: [PATCH] window-x11: Fix stage window check when running under non-X11 backends This code also runs when under the native backend for XWayland, so we can't crash on an invalid cast there. --- src/x11/window-x11.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index ebb6ec274..d4b968355 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -2803,9 +2803,13 @@ is_our_xwindow (MetaDisplay *display, return TRUE; { - MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ()); - if (xwindow == meta_backend_x11_get_xwindow (backend)) - return TRUE; + MetaBackend *backend = meta_get_backend (); + + if (META_IS_BACKEND_X11 (backend)) + { + if (xwindow == meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend))) + return TRUE; + } } /* Any windows created via meta_create_offscreen_window */