diff options
author | Simon Rettberg | 2020-02-16 10:24:21 +0100 |
---|---|---|
committer | Simon Rettberg | 2020-02-16 10:24:21 +0100 |
commit | ff570027f607016e2b263fedac1bda619a65e64e (patch) | |
tree | 0226d1ae35fe0e7447b2a7f6f64add6d3e37ce1f | |
parent | Use xrandr to actually set resolutions (diff) | |
download | beamergui-ff570027f607016e2b263fedac1bda619a65e64e.tar.gz beamergui-ff570027f607016e2b263fedac1bda619a65e64e.tar.xz beamergui-ff570027f607016e2b263fedac1bda619a65e64e.zip |
Fix xrandr command line for positioning...
-rw-r--r-- | src/xprivate.cpp | 2 | ||||
-rw-r--r-- | src/xx.cpp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/xprivate.cpp b/src/xprivate.cpp index 370c6f5..01f265f 100644 --- a/src/xprivate.cpp +++ b/src/xprivate.cpp @@ -652,7 +652,7 @@ void XPrivate::setOutputResolution(QStringList &args, OutputInfo *oi, int x, int // so we just pick the first one for now, as the GUI doesn't offer picking the rate XRRModeInfo *best = _modeMap[modes.first()]; args << "--output" << oi->outputName << "--mode" << best->name << "--rate" << QString::number(toVertRefresh(best), 'f', 2); - args << "--x" << QString::number(x) << "--y" << QString::number(y); + args << "--pos" << QString::asprintf("%dx%d", x, y); if (x == 0 && y == 0 && !args.contains(QLatin1String("--primary"))) { args.append("--primary"); } @@ -67,7 +67,7 @@ public: for (int i = 0; i < e->noutput; ++i) { auto *oi = x->_outputMap[e->outputs[i]]; cmd << "--output" << oi->outputName << "--mode" << mode->name << "--rate" << rate; - cmd << "--x" << QString::number(oi->crtc->x) << "--y" << QString::number(oi->crtc->y); + cmd << "--pos" << QString::asprintf("%dx%d", oi->crtc->x, oi->crtc->y); if (oi->crtc->x == 0 && oi->crtc->y == 0 && !cmd.contains("--primary")) { cmd << "--primary"; } @@ -614,8 +614,10 @@ bool ScreenSetup::runXrandr(QStringList &cmd) } } qDebug() << "XRANDR:" << cmd; - if (CommandLine::testMode()) - return true; + if (CommandLine::testMode()) { + cmd << "--dryrun"; + } + proc.setProcessChannelMode(QProcess::ProcessChannelMode::ForwardedChannels); proc.start("xrandr", cmd); proc.waitForFinished(5000); if (proc.state() == QProcess::Running) { |