[gnome-screensaver] Update which monitor the unlock dialog is on when layout changes



commit d4dcbd65a2df3c093c4e3a74bbbc75383eb9eadb
Author: Ray Strode <rstrode redhat com>
Date:   Fri Feb 12 14:16:33 2010 -0500

    Update which monitor the unlock dialog is on when layout changes
    
    Before we were moving the grabs but not the unlock dialog.
    Everything needs to be in lock step, otherwise:
    
    1) The unlock dialog won't get focus and will fail to work generally
    2) Assumptions in the code about the two being in lock-step will
    prove incorrect leading to the grabs getting dropped entirely.
    
    Part of fix for
    https://bugzilla.gnome.org/show_bug.cgi?id=609789
    CVE-2010-0422

 src/gs-manager.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-manager.c b/src/gs-manager.c
index 0a1b670..c4e2076 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -1491,10 +1491,24 @@ on_screen_monitors_changed (GdkScreen *screen,
                   n_monitors);
 
         if (n_monitors > n_windows) {
+
+                /* Tear down unlock dialog in case we want to move it
+                 * to a new monitor
+                 */
+                l = manager->priv->windows;
+                while (l != NULL) {
+                        gs_window_cancel_unlock_request (GS_WINDOW (l->data));
+                        l = l->next;
+                }
+
                 /* add more windows */
                 for (i = n_windows; i < n_monitors; i++) {
                         gs_manager_create_window_for_monitor (manager, screen, i);
                 }
+
+                /* And put unlock dialog up where ever it's supposed to be
+                 */
+                gs_manager_request_unlock (manager);
         } else {
 
                 gdk_x11_grab_server ();



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