From 04c99abaa2825c0c5f441542da1e698cfcb92f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Mon, 11 Apr 2016 18:53:26 +0300 Subject: compositor: add window back to compositor Remove window from compositor when calling meta_window_free and make sure to re-add window to the compositor when we re-create MetaWindow on MapRequest. https://bugzilla.gnome.org/show_bug.cgi?id=504876 https://bugzilla.gnome.org/show_bug.cgi?id=751833 --- src/compositor/compositor-xrender.c | 20 ++------------------ src/core/display.c | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c index fa8711bc..3e1eb5ea 100644 --- a/src/compositor/compositor-xrender.c +++ b/src/compositor/compositor-xrender.c @@ -2864,28 +2864,12 @@ xrender_free_window (MetaCompositor *compositor, { #ifdef HAVE_COMPOSITE_EXTENSIONS 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); */ - } + xwindow = meta_window_get_xwindow (window); - if (xwindow != None) - destroy_win (xrc->display, xwindow, FALSE); + destroy_win (xrc->display, xwindow, FALSE); #endif } diff --git a/src/core/display.c b/src/core/display.c index 2ccb64a5..adbcade4 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2116,8 +2116,22 @@ event_callback (XEvent *event, case MapRequest: if (window == NULL) { - window = meta_window_new (display, event->xmaprequest.window, - FALSE); + Window xwindow; + XWindowAttributes attr; + int result; + + xwindow = event->xmaprequest.window; + window = meta_window_new (display, xwindow, FALSE); + + meta_error_trap_push (display); + result = XGetWindowAttributes (display->xdisplay, xwindow, &attr); + meta_error_trap_pop (display, TRUE); + + if (result != 0) + { + meta_compositor_add_window (display->compositor, window, + xwindow, &attr); + } } /* if frame was receiver it's some malicious send event or something */ else if (!frame_was_receiver && window) -- cgit v1.2.1