[gnome-control-center/benzea/fix-single-display-405: 1/4] display: Correctly select "single" mode when opening display panel



commit e9150b67e8c497b34edb2f1de40e0914be43c59c
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Mar 7 18:52:07 2019 +0100

    display: Correctly select "single" mode when opening display panel
    
    The dialog tried to retain the current configuration mode. However,
    doing so means that we end up in the wrong mode in some situation (e.g.
    opening the dialog with two displays but only one enabled).
    
    Fix this by always selecting a configuration mode. This potentially
    switches the user from "join" to "single" if only one monitor is left.
    However, the user has no way to do this manually, so no unexpected UI
    change will happen.

 panels/display/cc-display-panel.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index bb574c5c9..4b7cd2359 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -754,14 +754,9 @@ rebuild_ui (CcDisplayPanel *panel)
    * And only in that mode do we allow mirroring. */
   if (n_outputs == 2 && !panel->lid_is_closed)
     {
-      CcDisplayConfigType types, type;
-
       gtk_widget_set_visible (panel->config_type_switcher_frame, TRUE);
-      type = cc_panel_get_selected_type (panel);
-      types = config_find_types (panel);
 
-      if (!(type & types))
-        cc_panel_set_selected_type (panel, config_select_type (panel));
+      cc_panel_set_selected_type (panel, config_select_type (panel));
     }
   else
     {


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