From 9b24ae2033f2b512bd955d5be02c690c389d75d2 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 24 Feb 2014 12:56:30 -0500 Subject: [PATCH] Revert "compositor: Delay meta_compositor_add_window until the first show" This reverts commit 4efe4483fbc7602e8358fda936074216a8e5544b. --- src/compositor/compositor.c | 28 +++++++++++++++++----------- src/core/window.c | 7 +++++-- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index a323c310c..dcf1136f6 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -140,6 +140,19 @@ meta_compositor_destroy (MetaCompositor *compositor) clutter_threads_remove_repaint_func (compositor->repaint_func_id); } +static void +add_win (MetaWindow *window) +{ + MetaScreen *screen = meta_window_get_screen (window); + MetaCompScreen *info = meta_screen_get_compositor_data (screen); + + g_return_if_fail (info != NULL); + + meta_window_actor_new (window); + + sync_actor_stacking (info); +} + static void process_damage (MetaCompositor *compositor, XDamageNotifyEvent *event, @@ -819,20 +832,13 @@ meta_compositor_add_window (MetaCompositor *compositor, { MetaScreen *screen = meta_window_get_screen (window); MetaDisplay *display = meta_screen_get_display (screen); - MetaCompScreen *info = meta_screen_get_compositor_data (screen); - - g_return_if_fail (info != NULL); - - /* Window was already added previously, probably coming - * back from hiding */ - if (window->compositor_private != NULL) - return; + DEBUG_TRACE ("meta_compositor_add_window\n"); meta_error_trap_push (display); - meta_window_actor_new (window); - meta_error_trap_pop (display); - sync_actor_stacking (info); + add_win (window); + + meta_error_trap_pop (display); } void diff --git a/src/core/window.c b/src/core/window.c index 81ca3f8ae..10a1b4087 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -1217,6 +1217,9 @@ _meta_window_shared_new (MetaDisplay *display, set_net_wm_state (window); } + if (screen->display->compositor) + meta_compositor_add_window (screen->display->compositor, window); + /* Sync stack changes */ meta_stack_thaw (window->screen->stack); @@ -2769,8 +2772,8 @@ meta_window_show (MetaWindow *window) break; } - meta_compositor_add_window (window->display->compositor, window); - meta_compositor_show_window (window->display->compositor, window, effect); + meta_compositor_show_window (window->display->compositor, + window, effect); } }