From beb98597af5e285f230d38d8ae498f1dee433a1a Mon Sep 17 00:00:00 2001 From: Nicolas Ouellet-Payeur Date: Fri, 21 Sep 2018 10:28:10 -0400 Subject: [PATCH] [Bug 10459] Add an 'AutoRefresh' xfconf toggle for displays This adds the /GlobalSettings/AutoRefresh boolean setting, in displays. It tells xfsettingsd to ignore monitor connections/disconnections. It defaults to TRUE, which is the old behavior. This lets users manage their monitors with another program if they want to, and avoid xfsettingsd re-setting their monitor configuration when they use a KVM switch, for instance. --- xfsettingsd/displays.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c index acd3bfe..7ba7bd7 100644 --- a/xfsettingsd/displays.c +++ b/xfsettingsd/displays.c @@ -51,6 +51,7 @@ /* Xfconf properties */ #define APPLY_SCHEME_PROP "/Schemes/Apply" +#define AUTO_REFRESH_PROP "/GlobalSettings/AutoRefresh" #define DEFAULT_SCHEME_NAME "Default" #define OUTPUT_FMT "/%s/%s" #define PRIMARY_PROP OUTPUT_FMT "/Primary" @@ -423,14 +424,17 @@ xfce_displays_helper_screen_on_event (GdkXEvent *xevent, gint event_num; gint j; guint n, m, nactive = 0; - gboolean found = FALSE, changed = FALSE; + gboolean found = FALSE, changed = FALSE, autorefresh; if (!e) return GDK_FILTER_CONTINUE; event_num = e->type - helper->event_base; - if (event_num == RRScreenChangeNotify) + autorefresh = xfconf_channel_get_bool (helper->channel, AUTO_REFRESH_PROP, + TRUE); + + if (autorefresh && event_num == RRScreenChangeNotify) { xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "RRScreenChangeNotify event received."); -- 2.19.0.444.g18242da7ef-goog