summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-09-21 12:02:46 +0200
committerCarlos Garnacho <carlosg@gnome.org>2020-10-21 18:57:12 +0200
commit1b39b92fa599f51046dbb5b2e26ff9fb907e13af (patch)
tree950be6b3bf9bef062a0579a7f81be97408ea5c57
parentd504086ebf20ee53c66213c4e06c99cc1a6432b6 (diff)
downloadmutter-1b39b92fa599f51046dbb5b2e26ff9fb907e13af.tar.gz
xwayland: Protect against MetaX11Display abruptly closing
If the MetaX11Display abruptly closed when X11 windows were present, we would still try to deal with them while freezing/thawing for the "fade out" animation. At the bottom of that, the X server may be gone, just try to cope with it. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1447
-rw-r--r--src/wayland/meta-window-xwayland.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wayland/meta-window-xwayland.c b/src/wayland/meta-window-xwayland.c
index 0c77ca5d7..cb4b667aa 100644
--- a/src/wayland/meta-window-xwayland.c
+++ b/src/wayland/meta-window-xwayland.c
@@ -169,11 +169,13 @@ apply_allow_commits_x11_property (MetaWindowXwayland *xwayland_window,
MetaWindow *window = META_WINDOW (xwayland_window);
MetaDisplay *display = window->display;
MetaX11Display *x11_display = display->x11_display;
- Display *xdisplay = x11_display->xdisplay;
MetaFrame *frame;
Window xwin;
guint32 property[1];
+ if (!x11_display)
+ return;
+
frame = meta_window_get_frame (window);
if (!frame)
xwin = window->xwindow;
@@ -186,12 +188,12 @@ apply_allow_commits_x11_property (MetaWindowXwayland *xwayland_window,
property[0] = !!allow_commits;
meta_x11_error_trap_push (x11_display);
- XChangeProperty (xdisplay, xwin,
+ XChangeProperty (x11_display->xdisplay, xwin,
x11_display->atom__XWAYLAND_ALLOW_COMMITS,
XA_CARDINAL, 32, PropModeReplace,
(guchar*) &property, 1);
meta_x11_error_trap_pop (x11_display);
- XFlush (xdisplay);
+ XFlush (x11_display->xdisplay);
}
static void