diff options
Diffstat (limited to 'src/xx.cpp')
-rw-r--r-- | src/xx.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -540,20 +540,25 @@ ConfigBackup ScreenSetup::setCenteredClone() break; } QStringList cmd; - QSize screenSize; // Currently unused + QSize screenSize; for (auto oi : a->_outputMap) { auto mode = a->getPreferredMode(oi, fallback); - if (mode != nullptr) { - if (int(mode->width) > screenSize.width()) { - screenSize.setWidth(int(mode->width)); - } - if (int(mode->height) > screenSize.height()) { - screenSize.setHeight(int(mode->height)); - } - const int x = (screenSize.width() - int(mode->width)) / 2; - const int y = (screenSize.height() - int(mode->height)) / 2; - a->setOutputResolution(cmd, oi, x, y, QSize(int(mode->width), int(mode->height))); + if (mode == nullptr) + continue; + if (int(mode->width) > screenSize.width()) { + screenSize.setWidth(int(mode->width)); } + if (int(mode->height) > screenSize.height()) { + screenSize.setHeight(int(mode->height)); + } + } + for (auto oi : a->_outputMap) { + auto mode = a->getPreferredMode(oi, fallback); + if (mode == nullptr) + continue; + const int x = (screenSize.width() - int(mode->width)) / 2; + const int y = (screenSize.height() - int(mode->height)) / 2; + a->setOutputResolution(cmd, oi, x, y, QSize(int(mode->width), int(mode->height))); } retval._ok = runXrandr(cmd); return retval; |