[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Handle disconnect and reconnect of multiple monitors (docking stations, etc)
noreply at xfce.org
noreply at xfce.org
Wed Nov 21 01:48:58 CET 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 4b6cfb04f350726c656b417c1f78cb78e750def6
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Tue Nov 20 19:48:24 2018 -0500
Handle disconnect and reconnect of multiple monitors (docking stations, etc)
---
src/gs-manager.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/gs-manager.c b/src/gs-manager.c
index 476a13a..b3c66c4 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -75,6 +75,7 @@ struct GSManagerPrivate {
guint fading : 1;
guint dialog_up : 1;
+ gint last_monitor_count;
time_t activate_time;
@@ -1473,7 +1474,7 @@ on_display_monitor_added (GdkDisplay *display,
gs_debug ("Monitor added on display %s, now there are %d",
gdk_display_get_name (display), n_monitors);
- if (n_monitors == 1) {
+ if (manager->priv->last_monitor_count == 0) {
/* Tidy up from lid-close or other headless event once we have a new monitor.
* See https://gitlab.gnome.org/GNOME/gtk/issues/1466
*/
@@ -1492,6 +1493,8 @@ on_display_monitor_added (GdkDisplay *display,
}
}
+ manager->priv->last_monitor_count = n_monitors;
+
/* add a new window */
gs_manager_create_window_for_monitor (manager, monitor);
@@ -1513,7 +1516,7 @@ on_display_monitor_removed (GdkDisplay *display,
int n_monitors;
GdkMonitor *last_monitor = NULL;
- n_monitors = gdk_display_get_n_monitors (display);
+ n_monitors = manager->priv->last_monitor_count = gdk_display_get_n_monitors (display);
gs_debug ("Monitor removed on display %s, now there are %d",
gdk_display_get_name (display), n_monitors);
@@ -1677,11 +1680,15 @@ gs_manager_create_windows (GSManager *manager) {
GSManager *
gs_manager_new (void) {
- GObject *manager;
+ GObject *manager;
+ GSManager *mgr;
manager = g_object_new (GS_TYPE_MANAGER, NULL);
- return GS_MANAGER (manager);
+ mgr = GS_MANAGER (manager);
+ mgr->priv->last_monitor_count = -1;
+
+ return mgr;
}
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