diff options
Diffstat (limited to 'src/xprivate.cpp')
-rw-r--r-- | src/xprivate.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/xprivate.cpp b/src/xprivate.cpp index 120fb66..ce7ce8c 100644 --- a/src/xprivate.cpp +++ b/src/xprivate.cpp @@ -82,9 +82,11 @@ void XPrivate::updateScreenResources() _modeMap.insert( _screenResources->modes[i].id, &_screenResources->modes[i]); + /* qDebug() << _screenResources->modes[i].id << "\t" << _screenResources->modes[i].width << "x" << _screenResources->modes[i].height; + */ } /* @@ -190,25 +192,23 @@ void XPrivate::updateScreenResources() qSort(screens.begin(), screens.end(), xRectLessThan); int endX = -0xffff; qDebug() << "From left to right"; - for (OutputInfo* output : screens) { - if (output->mode == nullptr) { - qDebug() << "(Ignoring" << output->outputName << "since it's disconnected)"; - } - if (output->crtc->x >= endX) { - QSize res(0, 0); - if (_modeMap.contains(output->crtc->mode)) { - auto mode = _modeMap.value(output->crtc->mode); - res = QSize(int(mode->width), int(mode->height)); - } - _resolutions.append(res); - endX = -0xffff; // Reset - } - output->position = _resolutions.size() - 1; - qDebug() << "Screen (" << output->crtc->x << "," << output->crtc->y << ") @" << output->crtc->width << "x" << output->crtc->height << "as screen" << output->position; - if (output->crtc->x + int(output->crtc->width) > endX) { - endX = output->crtc->x + int(output->crtc->width); - } - } + for (OutputInfo* output : screens) { + if (output->mode == nullptr) { + qDebug() << "(Ignoring" << output->outputName << "since it's disconnected)"; + continue; + } + if (output->crtc->x >= endX) { + QSize res(0, 0); + res = QSize(int(output->mode->width), int(output->mode->height)); + _resolutions.append(res); + endX = -0xffff; // Reset + } + output->position = _resolutions.size() - 1; + qDebug() << "Screen (" << output->crtc->x << "," << output->crtc->y << ") @" << output->mode->width << "x" << output->mode->height << "as screen" << output->position; + if (output->crtc->x + int(output->crtc->width) > endX) { + endX = output->crtc->x + int(output->mode->width); + } + } qDebug() << "Loaded."; } |