summaryrefslogtreecommitdiff
path: root/src/compositor/compositor-xrender.c
diff options
context:
space:
mode:
authorrcaridade145 <[email protected]>2020-02-29 13:01:36 +0000
committerVictor Kareh <[email protected]>2020-05-27 11:26:47 -0400
commitc7d07c2f4d00bb0e7252b773ef2e1d0559f733fd (patch)
tree29e22666188acd6f5f7879b2fadb0301f7e5f684 /src/compositor/compositor-xrender.c
parent071e7a7b4743aa360df037fd0c02a0300910a4a6 (diff)
downloadmarco-c7d07c2f4d00bb0e7252b773ef2e1d0559f733fd.tar.bz2
marco-c7d07c2f4d00bb0e7252b773ef2e1d0559f733fd.tar.xz
compositor: fix possible crash closing/destroying window . Fixes to previous commit.
Partially restore call to destroy_win in compositor when calling meta_window_free. This is needed to ensure that we never call meta_window_get_frame_bounds while windows is destroying. https://bugzilla.gnome.org/show_bug.cgi?id=751833 Based on commit https://gitlab.gnome.org/GNOME/metacity/-/commit/a9f28dbc26f5211ef08889109db3dc8c7ba76aca
Diffstat (limited to 'src/compositor/compositor-xrender.c')
-rw-r--r--src/compositor/compositor-xrender.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 59fbd93f..5b40b82e 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -3041,22 +3041,39 @@ xrender_end_move (MetaCompositor *compositor,
#endif
}
+#endif /* 0 */
+
static void
xrender_free_window (MetaCompositor *compositor,
MetaWindow *window)
{
#ifdef HAVE_COMPOSITE_EXTENSIONS
- /* FIXME: When an undecorated window is hidden this is called,
- but the window does not get readded if it is subsequentally shown again
- See http://bugzilla.gnome.org/show_bug.cgi?id=504876
-
- I don't *think* theres any need for this call anyway, leaving it out
- does not seem to cause any side effects so far, but I should check with
- someone who understands more. */
- /* destroy_win (compositor->display, window->xwindow, FALSE); */
+ MetaCompositorXRender *xrc;
+ MetaFrame *frame;
+ Window xwindow;
+
+ xrc = (MetaCompositorXRender *) compositor;
+ frame = meta_window_get_frame (window);
+ xwindow = None;
+
+ if (frame)
+ {
+ xwindow = meta_frame_get_xwindow (frame);
+ }
+ else
+ {
+ /* FIXME: When an undecorated window is hidden this is called, but the
+ * window does not get readded if it is subsequentally shown again. See:
+ * http://bugzilla.gnome.org/show_bug.cgi?id=504876
+ */
+ /* xwindow = meta_window_get_xwindow (window); */
+ }
+
+ if (xwindow != None)
+ destroy_win (xrc->display, xwindow, FALSE);
#endif
}
-#endif /* 0 */
+
static void
xrender_process_event (MetaCompositor *compositor,
@@ -3360,6 +3377,7 @@ static MetaCompositor comp_info = {
xrender_process_event,
xrender_get_window_surface,
xrender_set_active_window,
+ xrender_free_window,
xrender_maximize_window,
xrender_unmaximize_window,
};