diff options
author | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2020-08-19 01:26:49 +0200 |
---|---|---|
committer | Simon Steinbeiss <simon.steinbeiss@elfenbeinturm.at> | 2020-08-19 01:37:51 +0200 |
commit | bf3e7db85ec43505adf69a62cdaf1d6c7d32fe74 (patch) | |
tree | 92189941a1e401a9f1ac28bdea86ff7041540983 /xfsettingsd | |
parent | e853b5f00f73e168b59387b047fe66a587bb7b8a (diff) | |
download | xfce4-settings-bf3e7db85ec43505adf69a62cdaf1d6c7d32fe74.tar.gz |
xfsettingsd: Correctly get current xrandr scale
Diffstat (limited to 'xfsettingsd')
-rw-r--r-- | xfsettingsd/displays.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/xfsettingsd/displays.c b/xfsettingsd/displays.c index 27e98b8d..b967c133 100644 --- a/xfsettingsd/displays.c +++ b/xfsettingsd/displays.c @@ -1097,6 +1097,7 @@ xfce_displays_helper_list_crtcs (XfceDisplaysHelper *helper) crtcs = g_ptr_array_new_with_free_func ((GDestroyNotify) xfce_displays_helper_free_crtc); for (n = 0; n < helper->resources->ncrtc; ++n) { + XRRCrtcTransformAttributes *attr; xfsettings_dbg (XFSD_DEBUG_DISPLAYS, "Detected CRTC %lu.", helper->resources->crtcs[n]); gdk_x11_display_error_trap_push (helper->display); @@ -1119,8 +1120,17 @@ xfce_displays_helper_list_crtcs (XfceDisplaysHelper *helper) crtc->height = crtc_info->height; crtc->x = crtc_info->x; crtc->y = crtc_info->y; - crtc->scalex = 1.0; - crtc->scaley = 1.0; + if (XRRGetCrtcTransform (helper->xdisplay, helper->resources->crtcs[n], &attr) && attr) + { + crtc->scalex = XFixedToDouble (attr->currentTransform.matrix[0][0]); + crtc->scaley = XFixedToDouble (attr->currentTransform.matrix[1][1]); + XFree (attr); + } + else + { + crtc->scalex = 1.0; + crtc->scaley = 1.0; + } crtc->noutput = crtc_info->noutput; crtc->outputs = NULL; |