xrandr: update width and height params when wanted resolution was not found and we get the default one.
This commit is contained in:
parent
b15c902aee
commit
15b316a9af
@ -345,6 +345,7 @@ bool CIrrDeviceLinux::switchToFullscreen(bool reset)
|
|||||||
XRROutputInfo* output = XRRGetOutputInfo(display, res, output_id);
|
XRROutputInfo* output = XRRGetOutputInfo(display, res, output_id);
|
||||||
XRRCrtcInfo* crtc = XRRGetCrtcInfo(display, res, output->crtc);
|
XRRCrtcInfo* crtc = XRRGetCrtcInfo(display, res, output->crtc);
|
||||||
float refresh_rate, refresh_rate_new;
|
float refresh_rate, refresh_rate_new;
|
||||||
|
unsigned int mode0_width = -1, mode0_height = -1;
|
||||||
|
|
||||||
for (int i = 0; i < res->nmode; i++)
|
for (int i = 0; i < res->nmode; i++)
|
||||||
{
|
{
|
||||||
@ -361,6 +362,12 @@ bool CIrrDeviceLinux::switchToFullscreen(bool reset)
|
|||||||
w = mode->width;
|
w = mode->width;
|
||||||
h = mode->height;
|
h = mode->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bestMode == -1 && mode->id == output->modes[0])
|
||||||
|
{
|
||||||
|
mode0_width = w;
|
||||||
|
mode0_height = h;
|
||||||
|
}
|
||||||
|
|
||||||
if (bestMode == -1 && w == Width && h == Height)
|
if (bestMode == -1 && w == Width && h == Height)
|
||||||
{
|
{
|
||||||
@ -397,6 +404,8 @@ bool CIrrDeviceLinux::switchToFullscreen(bool reset)
|
|||||||
if (bestMode == -1)
|
if (bestMode == -1)
|
||||||
{
|
{
|
||||||
bestMode = 0;
|
bestMode = 0;
|
||||||
|
Width = mode0_width;
|
||||||
|
Height = mode0_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status s = XRRSetCrtcConfig(display, res, output->crtc, CurrentTime,
|
Status s = XRRSetCrtcConfig(display, res, output->crtc, CurrentTime,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user