[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Handle monitor change events more reliably (bug #14796)

noreply at xfce.org noreply at xfce.org
Fri Oct 26 01:28:03 CEST 2018


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit 52b2f4a25e8e35223d47c84c276a5e27d447e38d
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Thu Oct 25 19:27:58 2018 -0400

    Handle monitor change events more reliably (bug #14796)
---
 src/gs-manager.c    | 22 ++++++++++++++++------
 src/gs-window-x11.c |  1 -
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/gs-manager.c b/src/gs-manager.c
index 9c78eb0..2e312e1 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -1572,6 +1572,9 @@ on_display_monitor_added (GdkDisplay *display,
     gs_debug ("Monitor added on display %s, now there are %d",
               gdk_display_get_name (display), n_monitors);
 
+    /* add a new window */
+    gs_manager_create_window_for_monitor (manager, monitor);
+
     /* Tear down the unlock dialog in case we want to move it
      * to the new monitor
      */
@@ -1581,12 +1584,6 @@ on_display_monitor_added (GdkDisplay *display,
         gs_window_cancel_unlock_request (GS_WINDOW (l->data));
         l = l->next;
     }
-
-    /* add a new window */
-    gs_manager_create_window_for_monitor (manager, monitor);
-
-    /* and put unlock dialog up whereever it's supposed to be */
-    gs_manager_request_unlock (manager);
 }
 
 static void
@@ -1596,6 +1593,7 @@ on_display_monitor_removed (GdkDisplay *display,
 {
     GSList     *l;
     int         n_monitors;
+    GdkMonitor *last_monitor = NULL;
 
     n_monitors = gdk_display_get_n_monitors (display);
 
@@ -1622,11 +1620,23 @@ on_display_monitor_removed (GdkDisplay *display,
             gs_window_destroy (GS_WINDOW (l->data));
             manager->priv->windows = g_slist_delete_link (manager->priv->windows, l);
         }
+        else
+        {
+            last_monitor = this_monitor;
+            gs_window_cancel_unlock_request (GS_WINDOW (l->data));
+        }
         l = next;
     }
 
     gdk_display_flush (display);
     gdk_x11_ungrab_server ();
+
+    /* add a new window */
+    if (last_monitor)
+        gs_manager_create_window_for_monitor(manager, last_monitor);
+
+    /* and put unlock dialog up whereever it's supposed to be */
+    gs_manager_request_unlock(manager);
 }
 
 static void
diff --git a/src/gs-window-x11.c b/src/gs-window-x11.c
index 8add84e..a1d25f0 100644
--- a/src/gs-window-x11.c
+++ b/src/gs-window-x11.c
@@ -2515,7 +2515,6 @@ gs_window_init (GSWindow *window)
                       G_CALLBACK (on_drawing_area_draw),
                       NULL);
     create_info_bar (window);
-
 }
 
 static void

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list