From 87e878bbffb05a94996744372d982b25de4fb863 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 10 Jul 2019 14:51:02 +0200 Subject: [WindowManager] Wait for openbox a bit longer, add comments --- src/windowmanager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"; -- cgit v1.2.3-55-g7522