[mutter/wip/carlosg/on-demand-fixes: 3/3] core: Do not crash on untimely stack queries for X11 windows
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/on-demand-fixes: 3/3] core: Do not crash on untimely stack queries for X11 windows
- Date: Thu, 15 Aug 2019 13:11:36 +0000 (UTC)
commit a0bdf44c2d0c0875a074715a0419dc1eaad19b0c
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Aug 15 13:59:01 2019 +0200
core: Do not crash on untimely stack queries for X11 windows
Some meta_later operations may happen across XWayland being shutdown,
that trigger MetaStackTracker queries for X11 XIDs. This crashes as
the MetaX11Display is already NULL.
Return a NULL window in that case, as in "unknown stack ID".
https://gitlab.gnome.org/GNOME/mutter/merge_requests/728
src/core/display.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index fb4b127f5..3d1e33429 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1426,10 +1426,16 @@ meta_display_lookup_stack_id (MetaDisplay *display,
guint64 stack_id)
{
if (META_STACK_ID_IS_X11 (stack_id))
- return meta_x11_display_lookup_x_window (display->x11_display,
- (Window)stack_id);
+ {
+ if (!display->x11_display)
+ return NULL;
+ return meta_x11_display_lookup_x_window (display->x11_display,
+ (Window)stack_id);
+ }
else
- return meta_display_lookup_stamp (display, stack_id);
+ {
+ return meta_display_lookup_stamp (display, stack_id);
+ }
}
/* We return a pointer into a ring of static buffers. This is to make
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]