--- a/GUI/mainw/mainw.cpp
+++ b/GUI/mainw/mainw.cpp
@@ -435,6 +435,22 @@
if (!m_overridemin2tray && settings.value("min2tray").toBool()) {
e->ignore();
this->hide();
+ } else {
+ e->accept();
+ }
+
+ // It seems that we still have top level widgets at this point
+ // (e.g. the menus?). Checkable with
+ // QApplication::topLevelWidgets() The app is going to exit
+ // anyway, except apparently when running some KDE desktop
+ // versions ?? So call exit directly if we see KDE. I don't know
+ // that calling exit in all cases would be an issue actually.
+ char *cp = getenv("XDG_CURRENT_DESKTOP");
+ if (nullptr == cp) {
+ cp = getenv("XDG_SESSION_DESKTOP");
+ }
+ if (cp && !strcmp(cp, "KDE")) {
+ qApp->exit();
}
}