summary refs log tree commit diff
path: root/src/MainWindow.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-22 16:33:47 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-01-22 16:33:47 +0200
commit72cba5d9eb27e2ad936825a5b3084a72d1894dc1 (patch)
tree1109bef1c1f9159f13152ed078acc4e2ba64c690 /src/MainWindow.cc
parentFix ci (diff)
downloadnheko-72cba5d9eb27e2ad936825a5b3084a72d1894dc1.tar.xz
Disable minimize to tray except for the ChatPage
Diffstat (limited to 'src/MainWindow.cc')
-rw-r--r--src/MainWindow.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/MainWindow.cc b/src/MainWindow.cc

index fb55d189..228c900b 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc
@@ -226,7 +226,11 @@ MainWindow::showChatPage(QString userid, QString homeserver, QString token) void MainWindow::closeEvent(QCloseEvent *event) { - if (isVisible() && userSettings_->isTrayEnabled()) { + // Decide whether or not we should enable tray for the current page. + bool pageSupportsTray = + !welcome_page_->isVisible() && !login_page_->isVisible() && !register_page_->isVisible(); + + if (isVisible() && pageSupportsTray && userSettings_->isTrayEnabled()) { event->ignore(); hide(); }