summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-04-11 18:53:26 +0300
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-04-13 16:07:20 +0300
commit73218846ca432d9335ed211c44e5113d99610a6d (patch)
tree1caa0658c62ee234dcd1c88fa98969f822ba4f27
parent3c6e269ba39c3dac99a38301fa9b799c3c202043 (diff)
downloadmetacity-73218846ca432d9335ed211c44e5113d99610a6d.tar.gz
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
-rw-r--r--src/compositor/compositor-xrender.c20
-rw-r--r--src/core/display.c18
2 files changed, 18 insertions, 20 deletions
diff --git a/src/compositor/compositor-xrender.c b/src/compositor/compositor-xrender.c
index 4aef318b..8d69fe81 100644
--- a/src/compositor/compositor-xrender.c
+++ b/src/compositor/compositor-xrender.c
@@ -2865,28 +2865,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 d83c7b3d..8a97fb6b 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2117,8 +2117,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)