1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-07-06 00:25:26 +02:00

UI: fix app opening from macOS dock

A single click on the app icon on macOS dock should
open the app.

Change-Id: Ied215ee9288d6d46fd8852a7daa996db7ac0468f
This commit is contained in:
kkostiuk 2022-02-03 17:16:47 -05:00
parent 122777518a
commit 2d4ac408d7
3 changed files with 23 additions and 0 deletions

View file

@ -150,6 +150,9 @@ ApplicationWindow {
// layoutManager to handle as much as possible.
layoutManager.restoreWindowSettings()
}
if (Qt.platform.os.toString() === "osx") {
MainApplication.setEventFilter()
}
// This will trigger `visible = true`.
windowSettingsLoaded = true

View file

@ -445,3 +445,11 @@ MainApplication::cleanup()
#endif
QApplication::exit(0);
}
#ifdef Q_OS_MACOS
void
MainApplication::setEventFilter()
{
installEventFilter(this);
}
#endif

View file

@ -83,6 +83,18 @@ public:
return runOptions_[opt];
};
#ifdef Q_OS_MACOS
Q_INVOKABLE void setEventFilter();
bool eventFilter(QObject* object, QEvent* event)
{
if (event->type() == QEvent::ApplicationActivate) {
restoreApp();
}
return QApplication::eventFilter(object, event);
}
#endif // Q_OS_MACOS
Q_SIGNALS:
void closeRequested();