summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-22 17:34:00 +0100
committerSimon Rettberg2019-02-22 17:34:00 +0100
commit862706d9ca9f50e97ae5a6f48995238f59afd953 (patch)
treec42a0d752a0e8c8f6694ac43df947f1ccbf27825
parentFix things that I don't know how they even broke (diff)
downloadbeamergui-862706d9ca9f50e97ae5a6f48995238f59afd953.tar.gz
beamergui-862706d9ca9f50e97ae5a6f48995238f59afd953.tar.xz
beamergui-862706d9ca9f50e97ae5a6f48995238f59afd953.zip
DEBUG SPAAAM
-rw-r--r--src/xprivate.cpp43
1 files changed, 30 insertions, 13 deletions
diff --git a/src/xprivate.cpp b/src/xprivate.cpp
index de0440d..3e7c3a2 100644
--- a/src/xprivate.cpp
+++ b/src/xprivate.cpp
@@ -544,15 +544,19 @@ XRRModeInfo* XPrivate::getPreferredMode(const OutputInfo *oi, XRRModeInfo *fallb
best = mode; // If multiple resolutions match, use the largest one
}
}
- if (best != nullptr)
+ if (best != nullptr) {
+ qDebug() << oi->outputName << "Overriding UltraWide";
return best; // Ultrawide it is!
+ }
}
}
// "Normal" way of determining optimal resolution
if (oi->output->npreferred > 0) {
mode = oi->output->modes[0];
+ qDebug() << "Picking preferred mode for" << oi->outputName;
} else {
// No preferred one, try some more or less clever fallback
+ qDebug() << "No preferred mode for" << oi->outputName;
mode = None;
if (fallback != nullptr) {
mode = getOutputModeForResolution(oi->output, fallback->width, fallback->height);
@@ -573,8 +577,11 @@ XRRModeInfo* XPrivate::getPreferredMode(const OutputInfo *oi, XRRModeInfo *fallb
mode = oi->output->modes[0];
}
}
- if (!_modeMap.contains(mode))
- return nullptr;
+ if (!_modeMap.contains(mode)) {
+ qDebug() << "Could not pick a preferred mode";
+ return nullptr;
+ }
+ qDebug() << "Final Preferred mode of" << oi->outputName << "is" << _modeMap[mode]->width << "x" << _modeMap[mode]->height;
return _modeMap[mode];
}
@@ -583,16 +590,26 @@ QList<QSize> XPrivate::getTotalSize(const QList<OutputInfo*> &projectors, const
const int max = qMax(screens.size(), projectors.size());
QList<QSize> modes;
for (int i = 0; i < max; ++i) {
- XRRModeInfo *mode = nullptr;
- if (i < screens.size()) {
- mode = getPreferredMode(screens.at(i));
- }
- if (i < projectors.size()) {
- mode = getPreferredMode(projectors.at(i), mode);
- }
- if (mode != nullptr) {
- modes.append(QSize(int(mode->width), int(mode->height)));
- }
+ XRRModeInfo *mode = nullptr;
+ if (i < screens.size()) {
+ mode = getPreferredMode(screens.at(i));
+ if (mode != nullptr) {
+ qDebug() << "Screen wants" << mode->width << "x" << mode->height;
+ }
+ }
+ if (i < projectors.size()) {
+ mode = getPreferredMode(projectors.at(i), mode);
+ if (mode != nullptr) {
+ qDebug() << "Projector wants" << mode->width << "x" << mode->height;
+ }
+ }
+ if (mode != nullptr) {
+ QSize size(int(mode->width), int(mode->height));
+ modes.append(size);
+ qDebug() << "Next screen:" << size;
+ } else {
+ qDebug() << "Empty screen :(";
+ }
}
return modes;
}