[gnome-control-center] display: Split out rotation sanity checking



commit 1e6ea54aafb04b4bd1f5a7666181ab84b5ed8631
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Jun 3 17:26:49 2014 +0200

    display: Split out rotation sanity checking
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731166

 panels/display/cc-display-panel.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c
index d806fcb..eaa20ed 100644
--- a/panels/display/cc-display-panel.c
+++ b/panels/display/cc-display-panel.c
@@ -1922,6 +1922,21 @@ res_combo_changed (GtkComboBox    *combo,
 }
 
 static void
+sanity_check_rotation (GnomeRROutputInfo *output)
+{
+  GnomeRRRotation rotation;
+
+  rotation = gnome_rr_output_info_get_rotation (output);
+
+  /* other options such as reflection are not supported */
+  rotation &= (GNOME_RR_ROTATION_0 | GNOME_RR_ROTATION_90
+               | GNOME_RR_ROTATION_180 | GNOME_RR_ROTATION_270);
+  if (rotation == 0)
+    rotation = GNOME_RR_ROTATION_0;
+  gnome_rr_output_info_set_rotation (output, rotation);
+}
+
+static void
 show_setup_dialog (CcDisplayPanel *panel)
 {
   CcDisplayPanelPrivate *priv = panel->priv;
@@ -2264,14 +2279,7 @@ show_setup_dialog (CcDisplayPanel *panel)
         }
 
       /* check rotation */
-      rotation = gnome_rr_output_info_get_rotation (priv->current_output);
-
-      /* other options such as reflection are not supported */
-      rotation &= (GNOME_RR_ROTATION_0 | GNOME_RR_ROTATION_90
-                   | GNOME_RR_ROTATION_180 | GNOME_RR_ROTATION_270);
-      if (rotation == 0)
-        rotation = GNOME_RR_ROTATION_0;
-      gnome_rr_output_info_set_rotation (priv->current_output, rotation);
+      sanity_check_rotation (priv->current_output);
 
       apply_current_configuration (panel);
     }


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