From 382044b5bf828436175fa4c967dfedd210adf09b Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 16 Sep 2020 13:49:34 +0100 Subject: [PATCH 1/3] Low resolution switch bug fix This allows resolutions lower that 32x224 like 256x224 to work --- gfx/display_servers/dispserv_x11.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/gfx/display_servers/dispserv_x11.c b/gfx/display_servers/dispserv_x11.c index b97f48e54d..ce32bdcaeb 100644 --- a/gfx/display_servers/dispserv_x11.c +++ b/gfx/display_servers/dispserv_x11.c @@ -266,12 +266,12 @@ 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)); XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); + XRRSetScreenSize(dpy, window, width, height, + (int) ((25.4 * width) / 96.0), + (int) ((25.4 * height) / 96.0)); XSync(dpy, False); XRRFreeCrtcInfo(crtc); @@ -302,15 +302,16 @@ 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)); XRRSetCrtcConfig(dpy, res, res->crtcs[monitor_index], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); + XRRSetScreenSize(dpy, window, width, height, + (int) ((25.4 * width) / 96.0), + (int) ((25.4 * height) / 96.0)); XSync(dpy, False); + XRRFreeCrtcInfo(crtc); } XRRFreeOutputInfo(outputs); @@ -573,13 +574,13 @@ static void x11_display_server_destroy(void *data) XRRSetCrtcConfig(dpy, res,res->crtcs[i], CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0); XSync(dpy, False); + XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, + crtc->x, crtc->y, crtc->mode, crtc->rotation, + crtc->outputs, crtc->noutput); XRRSetScreenSize(dpy, window, crt_rrmode.width, crt_rrmode.height, (int) ((25.4 * crt_rrmode.width) / 96.0), (int) ((25.4 * crt_rrmode.height) / 96.0)); - XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, - crtc->x, crtc->y, crtc->mode, crtc->rotation, - crtc->outputs, crtc->noutput); XSync(dpy, False); From 17809688a6eaea58bd46cd2f16d2eaeabf5b6862 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 16 Sep 2020 14:07:15 +0100 Subject: [PATCH 2/3] Fix for low resoltion crash 256x240 resolutions and lower are now working --- gfx/display_servers/dispserv_x11.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/gfx/display_servers/dispserv_x11.c b/gfx/display_servers/dispserv_x11.c index ce32bdcaeb..c7bf97d410 100644 --- a/gfx/display_servers/dispserv_x11.c +++ b/gfx/display_servers/dispserv_x11.c @@ -269,9 +269,6 @@ static bool x11_display_server_set_resolution(void *data, XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); - XRRSetScreenSize(dpy, window, width, height, - (int) ((25.4 * width) / 96.0), - (int) ((25.4 * height) / 96.0)); XSync(dpy, False); XRRFreeCrtcInfo(crtc); @@ -305,9 +302,6 @@ static bool x11_display_server_set_resolution(void *data, XRRSetCrtcConfig(dpy, res, res->crtcs[monitor_index], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); - XRRSetScreenSize(dpy, window, width, height, - (int) ((25.4 * width) / 96.0), - (int) ((25.4 * height) / 96.0)); XSync(dpy, False); @@ -609,15 +603,15 @@ static void x11_display_server_destroy(void *data) res->crtcs[x11_monitor_index], CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0); XSync(dpy, False); - XRRSetScreenSize(dpy, window, - crt_rrmode.width, crt_rrmode.height, - (int) ((25.4 * crt_rrmode.width) / 96.0), - (int) ((25.4 * crt_rrmode.height) / 96.0)); XRRSetCrtcConfig(dpy, res, res->crtcs[x11_monitor_index], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); + XRRSetScreenSize(dpy, window, + crt_rrmode.width, crt_rrmode.height, + (int) ((25.4 * crt_rrmode.width) / 96.0), + (int) ((25.4 * crt_rrmode.height) / 96.0)); XSync(dpy, False); XRRFreeCrtcInfo(crtc); From b33f0b912109f82a6fcb22afd1c60f2073d167d0 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 16 Sep 2020 14:13:04 +0100 Subject: [PATCH 3/3] low resoluiton fis for RetroArch exit On exit changes --- gfx/display_servers/dispserv_x11.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/gfx/display_servers/dispserv_x11.c b/gfx/display_servers/dispserv_x11.c index c7bf97d410..205badd3a1 100644 --- a/gfx/display_servers/dispserv_x11.c +++ b/gfx/display_servers/dispserv_x11.c @@ -268,7 +268,7 @@ static bool x11_display_server_set_resolution(void *data, XSync(dpy, False); XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, - crtc->outputs, crtc->noutput); + crtc->outputs, crtc->noutput); XSync(dpy, False); XRRFreeCrtcInfo(crtc); @@ -571,10 +571,6 @@ static void x11_display_server_destroy(void *data) XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); - XRRSetScreenSize(dpy, window, - crt_rrmode.width, crt_rrmode.height, - (int) ((25.4 * crt_rrmode.width) / 96.0), - (int) ((25.4 * crt_rrmode.height) / 96.0)); XSync(dpy, False); @@ -608,10 +604,6 @@ static void x11_display_server_destroy(void *data) CurrentTime, crtc->x, crtc->y, crtc->mode, crtc->rotation, crtc->outputs, crtc->noutput); - XRRSetScreenSize(dpy, window, - crt_rrmode.width, crt_rrmode.height, - (int) ((25.4 * crt_rrmode.width) / 96.0), - (int) ((25.4 * crt_rrmode.height) / 96.0)); XSync(dpy, False); XRRFreeCrtcInfo(crtc);