summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-02-01 18:24:25 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2023-02-01 18:24:25 +0100
commit7734c4735acc8a5c91c38b83a14dec1827ccc64c (patch)
tree09782ad97ce75f813415d52d3322be72a4f0d973 /src
parentspoiler -> +warning (diff)
downloadnheko-7734c4735acc8a5c91c38b83a14dec1827ccc64c.tar.xz
Make notifications show the window again
fixes #1329
Diffstat (limited to 'src')
-rw-r--r--src/ChatPage.cpp8
-rw-r--r--src/timeline/TimelineViewManager.cpp6
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp
index cf44ae00..04523578 100644
--- a/src/ChatPage.cpp
+++ b/src/ChatPage.cpp
@@ -144,9 +144,13 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QObject *parent)
                 Q_UNUSED(eventid)
                 auto exWin = MainWindow::instance()->windowForRoom(roomid);
                 if (exWin) {
+                    exWin->setVisible(true);
+                    exWin->raise();
                     exWin->requestActivate();
                 } else {
                     view_manager_->rooms()->setCurrentRoom(roomid);
+                    MainWindow::instance()->setVisible(true);
+                    MainWindow::instance()->raise();
                     MainWindow::instance()->requestActivate();
                 }
             });
@@ -1621,9 +1625,13 @@ ChatPage::sendNotificationReply(const QString &roomid, const QString &eventid, c
     view_manager_->queueReply(roomid, eventid, body);
     auto exWin = MainWindow::instance()->windowForRoom(roomid);
     if (exWin) {
+        exWin->setVisible(true);
+        exWin->raise();
         exWin->requestActivate();
     } else {
         view_manager_->rooms()->setCurrentRoom(roomid);
+        MainWindow::instance()->setVisible(true);
+        MainWindow::instance()->raise();
         MainWindow::instance()->requestActivate();
     }
 }
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index 5d08e05e..0d5f788b 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -233,9 +233,13 @@ TimelineViewManager::showEvent(const QString &room_id, const QString &event_id)
     if (auto room = rooms_->getRoomById(room_id)) {
         auto exWin = MainWindow::instance()->windowForRoom(room_id);
         if (exWin) {
+            exWin->setVisible(true);
+            exWin->raise();
             exWin->requestActivate();
-        } else if (rooms_->currentRoom() != room) {
+        } else {
             rooms_->setCurrentRoom(room_id);
+            MainWindow::instance()->setVisible(true);
+            MainWindow::instance()->raise();
             MainWindow::instance()->requestActivate();
             nhlog::ui()->info("Activated room {}", room_id.toStdString());
         }