Fix a bug where the window would sometimes not show up after restoring from tray

After this patch, the window will not have the window manager's restore animation anymore, but will be reliably shown
This commit is contained in:
Janek Bevendorff 2017-02-14 18:32:40 +01:00
parent 5bb6c4d9e4
commit b73549fd35

View File

@ -728,18 +728,19 @@ void MainWindow::toggleWindow()
{
if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) {
setWindowState(windowState() | Qt::WindowMinimized);
hide();
QTimer::singleShot(0, this, SLOT(hide()));
if (config()->get("security/lockdatabaseminimize").toBool()) {
m_ui->tabWidget->lockDatabases();
}
}
else {
} else {
ensurePolished();
show();
setWindowState(windowState() & ~Qt::WindowMinimized);
raise();
activateWindow();
QTimer::singleShot(0, this, [this]() {
show();
raise();
activateWindow();
});
#if defined(Q_OS_LINUX) && ! defined(QT_NO_DBUS)
// re-register global D-Bus menu (needed on Ubuntu with Unity)