From 799fcdb5e0348ad18e29e3b9b07e2c0761ee7807 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 19 Apr 2021 07:38:38 -0700 Subject: [PATCH] Fixed CRTSwitchRes framebuffer bug --- gfx/display_servers/dispserv_x11.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gfx/display_servers/dispserv_x11.c b/gfx/display_servers/dispserv_x11.c index fb0834693c..b88427a602 100644 --- a/gfx/display_servers/dispserv_x11.c +++ b/gfx/display_servers/dispserv_x11.c @@ -261,11 +261,14 @@ static bool x11_display_server_set_resolution(void *data, XRRSetCrtcConfig(dpy, res,res->crtcs[i], CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0); XSync(dpy, False); + XRRSetScreenSize(dpy, window, width, height, (int) ((25.4 * width) / 96.0), (int) ((25.4 * height) / 96.0)); + XSync(dpy, False); XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); XSync(dpy, False); + XRRFreeCrtcInfo(crtc); } @@ -292,13 +295,13 @@ static bool x11_display_server_set_resolution(void *data, XRRSetCrtcConfig(dpy, res,res->crtcs[monitor_index], CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0); XSync(dpy, False); + XRRSetScreenSize(dpy, window, width, height, (int) ((25.4 * width) / 96.0), (int) ((25.4 * height) / 96.0)); + XSync(dpy, False); XRRSetCrtcConfig(dpy, res, res->crtcs[monitor_index], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); XSync(dpy, False); - - XRRFreeCrtcInfo(crtc); } XRRFreeOutputInfo(outputs);