mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Improve tray icon behavior on OS X.
Previously the main window had issues on restore: - was sometimes hidden again. - window was unresponsive, all actions disabled.
This commit is contained in:
parent
4f2d56a55f
commit
b8c1829857
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include "autotype/AutoType.h"
|
#include "autotype/AutoType.h"
|
||||||
#include "core/Config.h"
|
#include "core/Config.h"
|
||||||
@ -448,7 +449,7 @@ void MainWindow::changeEvent(QEvent *event)
|
|||||||
&& isTrayIconEnabled() && config()->get("GUI/MinimizeToTray").toBool())
|
&& isTrayIconEnabled() && config()->get("GUI/MinimizeToTray").toBool())
|
||||||
{
|
{
|
||||||
event->ignore();
|
event->ignore();
|
||||||
hide();
|
QTimer::singleShot(0, this, SLOT(hide()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
QMainWindow::changeEvent(event);
|
QMainWindow::changeEvent(event);
|
||||||
@ -578,6 +579,7 @@ void MainWindow::toggleWindow()
|
|||||||
hide();
|
hide();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||||
show();
|
show();
|
||||||
raise();
|
raise();
|
||||||
activateWindow();
|
activateWindow();
|
||||||
|
Loading…
Reference in New Issue
Block a user