diff options
author | Simon Rettberg | 2019-07-10 14:51:02 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-07-10 14:51:02 +0200 |
commit | 87e878bbffb05a94996744372d982b25de4fb863 (patch) | |
tree | 8b9f13ce75fdea7833e5a939fac91f9f91154d24 | |
parent | Rewrite list/news/help download and backup file handling (diff) | |
download | vmchooser2-87e878bbffb05a94996744372d982b25de4fb863.tar.gz vmchooser2-87e878bbffb05a94996744372d982b25de4fb863.tar.xz vmchooser2-87e878bbffb05a94996744372d982b25de4fb863.zip |
[WindowManager] Wait for openbox a bit longer, add comments
-rw-r--r-- | src/windowmanager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/windowmanager.cpp b/src/windowmanager.cpp index 077801e..2505c89 100644 --- a/src/windowmanager.cpp +++ b/src/windowmanager.cpp @@ -23,10 +23,12 @@ void ensureRunning() wm.closeReadChannel(QProcess::StandardOutput); wm.closeWriteChannel(); wm.waitForStarted(500); - QTimer::singleShot(100, []() { + QTimer::singleShot(500, []() { if (wm.state() == QProcess::Running) { qDebug() << "- Spawned openbox"; QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, killInstance); + // Try to make vmchooser the foreground window again, since starting the WM after + // vmchooser makes it lose focus QProcess::startDetached("wmctrl", QStringList() << "-a" << "vmchooser" << "-F"); } else if (wm.exitCode() == 0) { qDebug() << "- A WM is already running"; |