[gnome-control-center/benzea/ensure-valid-config-after-loading: 3/9] display: Reset resolution when switching configuration types



commit 21bb6416be4f436fe10e84661f0ae40c2b31219d
Author: Benjamin Berg <bberg redhat com>
Date:   Wed Mar 20 14:42:26 2019 +0100

    display: Reset resolution when switching configuration types
    
    It generally makes more sense to reset the resolution of a monitor after
    we switch configuration types. The main case where this is relevant is
    switching from a mirror configuration (CLONE) to either join or single.
    In this case, higher resolutions for monitors may become available.
    
    Note that this might be annoying to some users, because there may be
    monitors reporting a lower "preferred" resolution than the highest
    supported resolution. There is little we can do though, as always
    selecting the highest resolution doesn't seem like a much better
    approach.

 panels/display/cc-display-panel.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index d7573925a..7ea5ab01a 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -239,11 +239,13 @@ config_ensure_of_type (CcDisplayPanel *panel, CcDisplayConfigType type)
           if (cc_display_monitor_is_primary (output))
             {
               cc_display_monitor_set_active (output, TRUE);
+              cc_display_monitor_set_mode (output, cc_display_monitor_get_preferred_mode (output));
               set_current_output (panel, output, FALSE);
             }
           else
             {
               cc_display_monitor_set_active (output, FALSE);
+              cc_display_monitor_set_mode (output, cc_display_monitor_get_preferred_mode (output));
             }
         }
       break;
@@ -259,6 +261,7 @@ config_ensure_of_type (CcDisplayPanel *panel, CcDisplayConfigType type)
           CcDisplayMonitor *output = l->data;
 
           cc_display_monitor_set_active (output, cc_display_monitor_is_usable (output));
+          cc_display_monitor_set_mode (output, cc_display_monitor_get_preferred_mode (output));
         }
       break;
 


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