display: use the preferred width and height when moving inactive displays

Inactive displays have a width and height of zero, so use the preferred
width and height to allow correct positioning.

https://bugzilla.gnome.org/show_bug.cgi?id=704404
This commit is contained in:
Thomas Wood 2013-07-17 17:15:25 +01:00
parent 55b212075f
commit 76c30cd6ef

View file

@ -1338,6 +1338,12 @@ list_edges_for_output (GnomeRROutputInfo *output, GArray *edges)
gnome_rr_output_info_get_geometry (output, &x, &y, &w, &h);
if (!gnome_rr_output_info_is_active (output))
{
h = gnome_rr_output_info_get_preferred_height (output);
w = gnome_rr_output_info_get_preferred_width (output);
}
apply_rotation_to_geometry (output, &w, &h);
/* Top, Bottom, Left, Right */
@ -1538,6 +1544,12 @@ get_output_rect (GnomeRROutputInfo *output, GdkRectangle *rect)
{
gnome_rr_output_info_get_geometry (output, &rect->x, &rect->y, &rect->width, &rect->height);
if (!gnome_rr_output_info_is_active (output))
{
rect->width = gnome_rr_output_info_get_preferred_width (output);
rect->height = gnome_rr_output_info_get_preferred_height (output);
}
apply_rotation_to_geometry (output, &rect->width, &rect->height);
}