From 72cba5d9eb27e2ad936825a5b3084a72d1894dc1 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Mon, 22 Jan 2018 16:33:47 +0200 Subject: [PATCH] Disable minimize to tray except for the ChatPage --- src/MainWindow.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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(); }