diff options
author | Bastien Nocera <hadess@hadess.net> | 2014-06-03 18:07:14 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2014-06-05 17:16:41 +0200 |
commit | 42b1209130fe26825b3affc603006d26d01a5c5b (patch) | |
tree | 348040e3deaddb374486b23547af7a3d9e31f6f5 | |
parent | 27fa69a0cab55c6387f9aedd4b129275e1c9e154 (diff) | |
download | gnome-control-center-42b1209130fe26825b3affc603006d26d01a5c5b.tar.gz |
display: Fix problems when left-most monitor is rotated
When rotating the left-most monitor, we could end up with one
of two scenarios:
- Huge gap between monitor one and two when the left monitor is made
to be vertical
- Monitor two overlapping on top of monitor one when monitor is
back to being horizontal.
In addition to adding a bit more debug, we now take the old and new
rotation of monitor one into account when calculating the moving
screen edges.
https://bugzilla.gnome.org/show_bug.cgi?id=731166
-rw-r--r-- | panels/display/cc-display-panel.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/panels/display/cc-display-panel.c b/panels/display/cc-display-panel.c index 95988dd5c..b3bd38693 100644 --- a/panels/display/cc-display-panel.c +++ b/panels/display/cc-display-panel.c @@ -557,7 +557,23 @@ realign_outputs_after_resolution_change (CcDisplayPanel *self, GnomeRROutputInfo rotation = gnome_rr_output_info_get_rotation (output_that_changed); if (width == old_width && height == old_height && rotation == old_rotation) - return; + { + g_debug ("Not realigning outputs, configuration is the same for %s", gnome_rr_output_info_get_name (output_that_changed)); + return; + } + + g_debug ("Realigning outputs, configuration changed for %s", gnome_rr_output_info_get_name (output_that_changed)); + + /* Apply rotation to the geometry of the newly changed output, + * as well as to its old configuration */ + apply_rotation_to_geometry (output_that_changed, &width, &height); + if ((old_rotation & GNOME_RR_ROTATION_90) || (old_rotation & GNOME_RR_ROTATION_270)) + { + int tmp; + tmp = old_height; + old_height = old_width; + old_width = tmp; + } old_right_edge = x + old_width; old_bottom_edge = y + old_height; @@ -587,6 +603,7 @@ realign_outputs_after_resolution_change (CcDisplayPanel *self, GnomeRROutputInfo else if (output_y + output_height == old_bottom_edge) output_y = y + height - output_height; + g_debug ("Setting geometry for %s: %dx%d+%d+%d", gnome_rr_output_info_get_name (outputs[i]), output_width, output_height, output_x, output_y); gnome_rr_output_info_set_geometry (outputs[i], output_x, output_y, output_width, output_height); } } |