aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorLibravatar Keshav Bhatt <keshavnrj@gmail.com>2022-06-16 18:15:59 +0530
committerLibravatar Keshav Bhatt <keshavnrj@gmail.com>2022-06-16 18:15:59 +0530
commitff99a5f79874622b3ca02f46903c7390dd948259 (patch)
tree5981ce63e61d49fbc56336c02fd08e0781b974da /src/mainwindow.cpp
parent3dae93a104b59d3721bd236e0e3b254e3ab0740c (diff)
downloadwhatsie-ff99a5f79874622b3ca02f46903c7390dd948259.tar.gz
whatsie-ff99a5f79874622b3ca02f46903c7390dd948259.zip
fix: show notifications on correct screen
- show notification on screen where the main instance is running - closes #41
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 8b00d80..13b01eb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -190,9 +190,7 @@ void MainWindow::updateWindowTheme() {
}
QList<QWidget *> widgets = this->findChildren<QWidget *>();
- foreach (QWidget *w, widgets) {
- w->setPalette(qApp->palette());
- }
+ foreach (QWidget *w, widgets) { w->setPalette(qApp->palette()); }
setNotificationPresenter(webEngine->page()->profile());
if (lockWidget != nullptr) {
@@ -505,7 +503,9 @@ void MainWindow::notify(QString title, QString message) {
popup->style()->polish(qApp);
popup->setMinimumWidth(300);
popup->adjustSize();
- popup->present(title, message, QPixmap(":/icons/app/icon-64.png"));
+ int screenNumber = qApp->desktop()->screenNumber(this);
+ popup->present(screenNumber < 0 ? 0 : screenNumber, title, message,
+ QPixmap(":/icons/app/icon-64.png"));
}
}
@@ -844,7 +844,8 @@ void MainWindow::setNotificationPresenter(QWebEngineProfile *profile) {
} else {
popup->setMinimumWidth(300);
- popup->present(notification);
+ int screenNumber = qApp->desktop()->screenNumber(this);
+ popup->present(screenNumber, notification);
}
});
}