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



commit 60d5e6a8559d27431a1c4e27adfa50162e422935
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 adf2313a6..791ed523d 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -220,11 +220,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;
@@ -240,6 +242,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]