From 162f7953a39ece59c103b3eabcd20c6e90b82cc9 Mon Sep 17 00:00:00 2001 From: reionwong Date: Mon, 28 Mar 2022 15:26:27 +0800 Subject: [PATCH] fix(notification): switching the main screen position --- notificationd/screenhelper.cpp | 3 +++ notificationd/screenhelper.h | 1 + 2 files changed, 4 insertions(+) diff --git a/notificationd/screenhelper.cpp b/notificationd/screenhelper.cpp index a6d4ecc..306141a 100644 --- a/notificationd/screenhelper.cpp +++ b/notificationd/screenhelper.cpp @@ -24,6 +24,9 @@ ScreenHelper::ScreenHelper(QObject *parent) : QObject(parent) { + connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &ScreenHelper::screenGeometryChanged); + connect(qGuiApp, &QGuiApplication::primaryScreenChanged, this, &ScreenHelper::availableScreenRectChanged); + connect(qApp->primaryScreen(), &QScreen::geometryChanged, this, &ScreenHelper::screenGeometryChanged); connect(qApp->primaryScreen(), &QScreen::availableGeometryChanged, this, &ScreenHelper::availableScreenRectChanged); } diff --git a/notificationd/screenhelper.h b/notificationd/screenhelper.h index 4ca4f1d..0f75007 100644 --- a/notificationd/screenhelper.h +++ b/notificationd/screenhelper.h @@ -22,6 +22,7 @@ #include #include +#include class ScreenHelper : public QObject {