Commit 2f597ea9 authored by Matthias Clasen's avatar Matthias Clasen Committed by William Jon McCann

Fix adding monitors

Make sure to show windows that are added.  And fix an off by one bug.
parent 2449c945
......@@ -1450,6 +1450,10 @@ gs_manager_create_window_for_monitor (GSManager *manager,
connect_window_signals (manager, window);
manager->priv->windows = g_slist_append (manager->priv->windows, window);
if (manager->priv->active && !manager->priv->fading) {
gtk_widget_show (window);
}
}
static void
......@@ -1471,21 +1475,25 @@ on_screen_monitors_changed (GdkScreen *screen,
if (n_monitors > n_windows) {
/* add more windows */
for (i = n_windows; i < n_monitors; i++) {
gs_manager_create_window_for_monitor (manager, screen, i - 1);
gs_manager_create_window_for_monitor (manager, screen, i);
}
} else {
/* remove the extra windows */
for (l = manager->priv->windows; l != NULL; l = l->next) {
l = manager->priv->windows;
while (l != NULL) {
GdkScreen *this_screen;
int this_monitor;
GSList *next = l->next;
this_screen = gs_window_get_screen (GS_WINDOW (l->data));
this_monitor = gs_window_get_monitor (GS_WINDOW (l->data));
if (this_screen == screen && this_monitor >= n_monitors) {
manager_maybe_stop_job_for_window (manager, GS_WINDOW (l->data));
g_hash_table_remove (manager->priv->jobs, l->data);
gs_window_destroy (GS_WINDOW (l->data));
manager->priv->windows = g_slist_delete_link (manager->priv->windows, l);
}
l = next;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment