[gnome-control-center/benzea/display-snap-after-changes: 3/3] display: Run snapping after certain modifications



commit 21ad3b0e820126cefced343e5fcbba40fe9aff94
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.

 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 4261653d7..2c6bf85e3 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -553,6 +553,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);
 }
 
@@ -647,6 +648,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);
 }
 
@@ -855,6 +857,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);
     }
 }
@@ -978,6 +981,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);
 }
 
@@ -1791,6 +1795,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]