mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-24 08:44:03 +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:
parent
122777518a
commit
2d4ac408d7
3 changed files with 23 additions and 0 deletions
|
@ -150,6 +150,9 @@ ApplicationWindow {
|
||||||
// layoutManager to handle as much as possible.
|
// layoutManager to handle as much as possible.
|
||||||
layoutManager.restoreWindowSettings()
|
layoutManager.restoreWindowSettings()
|
||||||
}
|
}
|
||||||
|
if (Qt.platform.os.toString() === "osx") {
|
||||||
|
MainApplication.setEventFilter()
|
||||||
|
}
|
||||||
|
|
||||||
// This will trigger `visible = true`.
|
// This will trigger `visible = true`.
|
||||||
windowSettingsLoaded = true
|
windowSettingsLoaded = true
|
||||||
|
|
|
@ -445,3 +445,11 @@ MainApplication::cleanup()
|
||||||
#endif
|
#endif
|
||||||
QApplication::exit(0);
|
QApplication::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
void
|
||||||
|
MainApplication::setEventFilter()
|
||||||
|
{
|
||||||
|
installEventFilter(this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -83,6 +83,18 @@ public:
|
||||||
return runOptions_[opt];
|
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:
|
Q_SIGNALS:
|
||||||
void closeRequested();
|
void closeRequested();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue