Merge branch 'release/2.3.2' into develop

This commit is contained in:
Janek Bevendorff 2018-03-18 01:14:42 +01:00
commit e92d5e80ee
No known key found for this signature in database
GPG key ID: 2FDEB0D40BCA5E11
18 changed files with 180 additions and 70 deletions

View file

@ -899,7 +899,7 @@ void MainWindow::updateTrayIcon()
m_trayIcon->setContextMenu(menu);
m_trayIcon->setIcon(filePath()->applicationIcon());
m_trayIcon->setIcon(filePath()->trayIcon());
m_trayIcon->show();
}
if (m_ui->tabWidget->hasLockableDatabases()) {
@ -971,7 +971,11 @@ void MainWindow::trayIconTriggered(QSystemTrayIcon::ActivationReason reason)
void MainWindow::hideWindow()
{
saveWindowInformation();
#ifndef Q_OS_MAC
#if !defined(Q_OS_LINUX) && !defined(Q_OS_MAC)
// On some Linux systems, the window should NOT be minimized and hidden (i.e. not shown), at
// the same time (which would happen if both minimize on startup and minimize to tray are set)
// since otherwise it causes problems on restore as seen on issue #1595. Hiding it is enough.
// TODO: Add an explanation for why this is also not done on Mac (or remove the check)
setWindowState(windowState() | Qt::WindowMinimized);
#endif
QTimer::singleShot(0, this, SLOT(hide()));
@ -983,7 +987,7 @@ void MainWindow::hideWindow()
void MainWindow::toggleWindow()
{
if ((QApplication::activeWindow() == this) && isVisible() && !isMinimized()) {
if (isVisible() && !isMinimized()) {
hideWindow();
} else {
bringToFront();