[Xfce4-commits] <xfce4-settings:master> Add support to restore the outputs' positions from xfconf
Nick Schermer
noreply at xfce.org
Sat Aug 28 23:04:09 CEST 2010
Updating branch refs/heads/master
to 9e186dd3a8a7b9428989b450ab8b56cb60fc8910 (commit)
from b4090f477c85b348f35ec838ebd75e6c394be33e (commit)
commit 9e186dd3a8a7b9428989b450ab8b56cb60fc8910
Author: Lionel Le Folgoc <mrpouit at gmail.com>
Date: Fri Jun 11 19:07:19 2010 +0200
Add support to restore the outputs' positions from xfconf
xfce4-settings-helper/displays.c | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/xfce4-settings-helper/displays.c b/xfce4-settings-helper/displays.c
index ae19806..6a24bad 100644
--- a/xfce4-settings-helper/displays.c
+++ b/xfce4-settings-helper/displays.c
@@ -290,6 +290,7 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
#ifdef HAS_RANDR_ONE_POINT_THREE
gint is_primary;
#endif
+ gint pos_x, pos_y;
gchar *output_name, *output_res;
gdouble output_rate;
XRROutputInfo *output_info;
@@ -370,6 +371,12 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
is_primary = xfconf_channel_get_bool (helper->channel, property, FALSE);
#endif
+ g_snprintf (property, sizeof (property), "/%s/Output%d/Position/X", scheme, n);
+ pos_x = xfconf_channel_get_int (helper->channel, property, 0);
+
+ g_snprintf (property, sizeof (property), "/%s/Output%d/Position/Y", scheme, n);
+ pos_y = xfconf_channel_get_int (helper->channel, property, 0);
+
/* walk the existing outputs */
for (m = 0; m < resources->noutput; ++m)
{
@@ -461,21 +468,18 @@ xfce_displays_helper_channel_apply (XfceDisplaysHelper *helper,
/* get the sizes of the mode to enforce */
if (rot == RR_Rotate_90 || rot == RR_Rotate_270)
xfce_displays_helper_process_screen_size (xdisplay, resources->modes[j].height,
- resources->modes[j].width, crtc_info->x,
- crtc_info->y, &width, &height, &mm_width,
- &mm_height);
+ resources->modes[j].width, pos_x, pos_y,
+ &width, &height, &mm_width, &mm_height);
else
xfce_displays_helper_process_screen_size (xdisplay, resources->modes[j].width,
- resources->modes[j].height, crtc_info->x,
- crtc_info->y, &width, &height, &mm_width,
- &mm_height);
+ resources->modes[j].height, pos_x, pos_y,
+ &width, &height, &mm_width, &mm_height);
/* check if we really need to do something */
if (crtc_info->mode != mode || crtc_info->rotation != rot)
{
- if (XRRSetCrtcConfig (xdisplay, resources, crtc,
- crtc_info->timestamp, crtc_info->x, crtc_info->y,
- mode, rot, outputs, noutput) != RRSetConfigSuccess)
+ if (XRRSetCrtcConfig (xdisplay, resources, crtc, crtc_info->timestamp,
+ pos_x, pos_y, mode, rot, outputs, noutput) != RRSetConfigSuccess)
g_warning ("Failed to configure %s.", output_info->name);
}
More information about the Xfce4-commits
mailing list