diff options
author | Bastien Nocera <hadess@hadess.net> | 2014-06-03 17:26:49 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2014-06-05 17:16:41 +0200 |
commit | 1e6ea54aafb04b4bd1f5a7666181ab84b5ed8631 (patch) | |
tree | 493d7f9b643079de91a060c40803a0caad97901d | |
parent | 64b3fdc2fcdde46e99f657a3da1ffc7c2f7c508c (diff) | |
download | gnome-control-center-1e6ea54aafb04b4bd1f5a7666181ab84b5ed8631.tar.gz |
display: Split out rotation sanity checking
https://bugzilla.gnome.org/show_bug.cgi?id=731166
-rw-r--r-- | 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 d806fcb4e..eaa20edf8 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); } |