protect from closing on changing sessions

--disable quiting the app when there are no windows
shown. There are cases that between states some
windows may not exist. E.g. when changing sessions
and when activating/deactivating screens
pull/1/head
Michail Vourlakos 8 years ago
parent fe0e23b935
commit d223e23291

@ -66,6 +66,8 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
KLocalizedString::setApplicationDomain("latte-dock");
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("latte-dock")));
//protect from closing app when changing to "alternative session" and back
app.setQuitOnLastWindowClosed(false);
configureAboutData();
@ -86,8 +88,10 @@ int main(int argc, char **argv)
QLockFile lockFile {QDir::tempPath() + "/latte-dock.lock"};
int timeout {100};
if (parser.isSet(QStringLiteral("replace")) || parser.isSet(QStringLiteral("import"))) {
qint64 pid{-1};
qint64 pid{ -1};
if (lockFile.getLockInfo(&pid, nullptr, nullptr)) {
kill(static_cast<pid_t>(pid), SIGINT);
timeout = 3000;

Loading…
Cancel
Save