[gnome-control-center/gnome-3-30] display: Run snapping after certain modifications



commit 733dc2e51b85d88c37143cd5055b88ae9e2d2d25
Author: Benjamin Berg <bberg redhat com>
Date:   Tue Oct 23 23:16:55 2018 +0200

    display: Run snapping after certain modifications
    
    Anything that affects the size of the screen (or its existance) may
    result in invalid configurations. Do a small effort in trying to fix
    this by calling into the snapping algorithm for the modified monitor.
    
    Addresses issue #247 to a large extend.
    
    (cherry picked from commit 32a6f9befa213c0fadbf32be4b71157d1b6078ce)

 panels/display/cc-display-panel.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index 543c4628f..e5c54f1b3 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -542,6 +542,7 @@ orientation_row_activated (CcDisplayPanel *panel,
   CcDisplayRotation rotation = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (row), "rotation"));
 
   cc_display_monitor_set_rotation (panel->current_output, rotation);
+  cc_display_config_snap_output (panel->current_config, panel->current_output);
   update_apply_button (panel);
 }
 
@@ -629,6 +630,7 @@ resolution_row_activated (CcDisplayPanel *panel,
   if (!display_mode_supported_at_scale (mode, scale))
     cc_display_monitor_set_scale (panel->current_output, 1.0);
 
+  cc_display_config_snap_output (panel->current_config, panel->current_output);
   update_apply_button (panel);
 }
 
@@ -827,6 +829,7 @@ scale_buttons_active (CcDisplayPanel *panel,
   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
     {
       cc_display_monitor_set_scale (panel->current_output, scale);
+      cc_display_config_snap_output (panel->current_config, panel->current_output);
       update_apply_button (panel);
     }
 }
@@ -948,6 +951,7 @@ underscanning_switch_active (CcDisplayPanel *panel,
 {
   cc_display_monitor_set_underscanning (panel->current_output,
                                         gtk_switch_get_active (GTK_SWITCH (button)));
+  cc_display_config_snap_output (panel->current_config, panel->current_output);
   update_apply_button (panel);
 }
 
@@ -1689,6 +1693,7 @@ output_switch_active (CcDisplayPanel *panel,
 {
   cc_display_monitor_set_active (panel->current_output,
                                  gtk_switch_get_active (GTK_SWITCH (button)));
+  cc_display_config_snap_output (panel->current_config, panel->current_output);
   update_apply_button (panel);
 }
 


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