From 6561b53346b0828823638527002fc34936691be4 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 7 Feb 2014 19:52:34 -0500 Subject: [PATCH] display: Clean up screen management code --- src/core/display.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 37aab062b..e5dd43f66 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -808,12 +808,7 @@ meta_display_open (void) screen = meta_screen_new (the_display, i, timestamp); - if (screen) - screens = g_slist_prepend (screens, screen); - - the_display->screens = screens; - - if (screens == NULL) + if (!screen) { /* This would typically happen because all the screens already * have window managers. @@ -822,24 +817,19 @@ meta_display_open (void) return FALSE; } + screens = g_slist_prepend (screens, screen); + + the_display->screens = screens; + enable_compositor (the_display); - - /* Now manage all existing windows */ - tmp = the_display->screens; - while (tmp != NULL) - { - MetaScreen *screen = tmp->data; - meta_screen_create_guard_window (screen); + meta_screen_create_guard_window (screen); - /* We know that if mutter is running as a Wayland compositor, - * we start out with no windows. - */ - if (!meta_is_wayland_compositor ()) - meta_screen_manage_all_windows (screen); - - tmp = tmp->next; - } + /* We know that if mutter is running as a Wayland compositor, + * we start out with no windows. + */ + if (!meta_is_wayland_compositor ()) + meta_screen_manage_all_windows (screen); { Window focus;