[metacity] display: move meta_compositor_add_window call to meta_window_new



commit 11550a9a182e5397b31efb9d2c44f4206bb56d50
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Mar 5 01:44:22 2017 +0200

    display: move meta_compositor_add_window call to meta_window_new

 src/core/display.c |   10 +---------
 src/core/window.c  |    2 ++
 2 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 047f338..0cd062c 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -2295,17 +2295,9 @@ event_callback (XEvent   *event,
     case MapRequest:
       if (window == NULL)
         {
-          Window xwindow;
-
-          xwindow = event->xmaprequest.window;
-          window = meta_window_new (display, xwindow, FALSE,
+          window = meta_window_new (display, event->xmaprequest.window, FALSE,
                                     META_EFFECT_TYPE_CREATE);
 
-          if (window != NULL)
-            {
-              meta_compositor_add_window (display->compositor, window, xwindow);
-            }
-
           /* The window might have initial iconic state, but this is a
            * MapRequest, fall through to ensure it is unminimized in
            * that case.
diff --git a/src/core/window.c b/src/core/window.c
index 682052d..440aa86 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -837,6 +837,8 @@ meta_window_new (MetaDisplay    *display,
       set_net_wm_state (window);
     }
 
+  meta_compositor_add_window (window->display->compositor, window, window->xwindow);
+
   /* Sync stack changes */
   meta_stack_thaw (window->screen->stack);
 


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