summaryrefslogtreecommitdiff
path: root/src/compositor/compositor-xrender.c
diff options
context:
space:
mode:
authorAlberts Muktupāvels <[email protected]>2015-07-21 03:40:32 +0200
committerinfirit <[email protected]>2015-09-14 18:59:28 +0200
commit768fdd8d3852e67555a585da28b6404a97853cbd (patch)
tree46e26bd3ed6ad3fffa0912baadac59448d3396b7 /src/compositor/compositor-xrender.c
parenta9b261b5c6a49ed3fa9400304e52ea9fdb528a0c (diff)
downloadmarco-768fdd8d3852e67555a585da28b6404a97853cbd.tar.bz2
marco-768fdd8d3852e67555a585da28b6404a97853cbd.tar.xz
compositor: fix possible crash closing/destroying window
Diffstat (limited to 'src/compositor/compositor-xrender.c')
-rw-r--r--src/compositor/compositor-xrender.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 623d6ce8..c1218ebc 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -2681,23 +2681,38 @@ xrender_end_move (MetaCompositor *compositor,
#ifdef HAVE_COMPOSITE_EXTENSIONS
#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,
@@ -2979,6 +2994,7 @@ static MetaCompositor comp_info = {
xrender_process_event,
xrender_get_window_pixmap,
xrender_set_active_window,
+ xrender_free_window,
xrender_maximize_window,
xrender_unmaximize_window,
};