diff options
author | Simon Rettberg | 2018-12-31 15:29:13 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-12-31 15:29:13 +0100 |
commit | 15426a68638be35c98af921e033bc825250678e3 (patch) | |
tree | a9e2ebfdaf5adc04695632b125f0a8452b4d0840 /src/xx.cpp | |
parent | Fix bug (diff) | |
download | beamergui-15426a68638be35c98af921e033bc825250678e3.tar.gz beamergui-15426a68638be35c98af921e033bc825250678e3.tar.xz beamergui-15426a68638be35c98af921e033bc825250678e3.zip |
Parse EDID for missing modes (ultrawide issue)
For some reason X ignores ultrawide resolutions in the EDID data...
Additionally (at least on LG models) the EDID data wrongly says 1080p
would be the preferred resolution of the screen, so we now take the
physical dimensions of the screen into account and override that
decision, if applicable. This assumes square pixels, but that shouldn't
be too crazy of an assumption.
Diffstat (limited to 'src/xx.cpp')
-rw-r--r-- | src/xx.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -225,6 +225,11 @@ static double toVertRefresh(const XRRModeInfo *mode) return 0; } +void ScreenSetup::addMissingEdidResolutions() +{ + a->addMissingEdidResolutions(); +} + //___________________________________________________________________________ void ScreenSetup::updateScreenResources() { @@ -254,10 +259,11 @@ void ScreenSetup::initModes() for (XRRModeInfo *mode : a->_modeMap) { if (toVertRefresh(mode) < 58 || toVertRefresh(mode) > 61) continue; // Play it safe and consider only those for copying that are 60Hz - wanted.remove(RES(mode->width, mode->height)); + if (!wanted.remove(RES(mode->width, mode->height))) + continue; // Is not a wanted resolution // Make sure all outputs got it for (OutputInfo *info : a->_outputMap) { - if (a->getOutputModeForResolution(info->output, mode->width, mode->height)) + if (a->getOutputModeForResolution(info->output, mode->width, mode->height) != None) continue; XRRAddOutputMode(a->_display, info->id, mode->id); } @@ -269,7 +275,7 @@ void ScreenSetup::initModes() unsigned int y = res >> 16; createMode(x, y, 60, QString::asprintf("%ux%u", x, y)); } - if (!wanted.isEmpty()) { + if (!wanted.isEmpty()) { // Modes were added, update for final loop below updateScreenResources(); } // Finally copy all those the projector supports to other outputs |