[metacity/gnome-3-18] compositor: add window back to compositor



commit 04c99abaa2825c0c5f441542da1e698cfcb92f01
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Mon Apr 11 18:53:26 2016 +0300

    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 fa8711b..3e1eb5e 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 2ccb64a..adbcade 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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]