/***************************************************************************
- * Copyright (C) 2005-2015 by the Quassel Project *
+ * Copyright (C) 2005-2018 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This contains code from KStatusNotifierItem, part of the KDE libs *
#ifdef Q_OS_WIN
_dwTickCount = 0;
#endif
+#ifdef Q_OS_MAC
+ GetFrontProcess(&_procNum);
+#endif
}
}
+// NOTE: Window activation stuff seems to work just fine in Plasma 5 without requiring X11 hacks.
+// TODO: Evaluate cleaning all this up once we can get rid of Qt4/KDE4
+
// Code taken from KStatusNotifierItem for handling minimize/restore
bool GraphicalUi::checkMainWidgetVisibility(bool perform)
// this does not actually work on all platforms... and causes more evil than good
// mainWidget()->move(mainWidget()->frameGeometry().topLeft()); // avoid placement policies
+#ifdef Q_OS_MAC
+ SetFrontProcess(&instance()->_procNum);
+#else
mainWidget()->show();
mainWidget()->raise();
mainWidget()->activateWindow();
+#endif
#endif /* HAVE_KDE4 */
}
#endif
if (instance()->isHidingMainWidgetAllowed())
+#ifdef Q_OS_MAC
+ ShowHideProcess(&instance()->_procNum, false);
+#else
mainWidget()->hide();
+#endif
}