From: John Wolfe Date: Fri, 22 Jan 2021 20:25:40 +0000 (-0800) Subject: [resolution/x11] Preserve the rotation X-Git-Tag: stable-11.3.0~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69b5354e7df1ab0579f1c25fa2e0cf5414cec037;p=thirdparty%2Fopen-vm-tools.git [resolution/x11] Preserve the rotation The screen orientation/rotation was being reset on each mode set. In general that is not a bad behavior. But it does break with a fit to window and such as it will continuously reset the user requested orientation. This patch preserves the orientation/rotation on mode changes. --- diff --git a/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c b/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c index 6340b113b..d2add4464 100644 --- a/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c +++ b/open-vm-tools/services/plugins/resolutionSet/resolutionRandR12.c @@ -779,6 +779,7 @@ RandR12SetupOutput(Display *display, // IN: The display connection int height) // IN: Height of scanout area { RRCrtc crtcID = info->xrrRes->crtcs[rrOutput->crtc]; + XRRCrtcInfo *crtcInfo = info->crtcs[rrOutput->crtc]; XRRModeInfo *mode; Status ret; @@ -791,9 +792,14 @@ RandR12SetupOutput(Display *display, // IN: The display connection if (!mode) { return FALSE; } + if (!crtcInfo) { + g_warning("%s: Wasn't able to find crtc info for crtc id %d.\n", __func__, + (int)crtcID); + return FALSE; + } ret = XRRSetCrtcConfig(display, info->xrrRes, crtcID, CurrentTime, x, y, - mode->id, RR_Rotate_0, &rrOutput->id, 1); + mode->id, crtcInfo->rotation, &rrOutput->id, 1); if (ret == Success) { rrOutput->mode = mode->id; return TRUE;