[gnome-screensaver/gnome-2-28] Fix adding monitors
- From: William Jon McCann <mccann src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-screensaver/gnome-2-28] Fix adding monitors
- Date: Tue, 3 Nov 2009 01:07:21 +0000 (UTC)
commit 7fe68e36f9d5254baf86bd94df355a620204600e
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Nov 2 17:00:23 2009 -0500
Fix adding monitors
Make sure to show windows that are added. And fix an off by one bug.
src/gs-manager.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-manager.c b/src/gs-manager.c
index e8ffc0b..bb0ddf6 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -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;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]