Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Cambra <claudio.cambra@gmail.com>2022-02-14 14:12:45 +0300
committerClaudio Cambra <claudio.cambra@gmail.com>2022-02-14 14:12:45 +0300
commit6ebf489a512fab10dee3103044096b4e0b4ac827 (patch)
tree6b426167e4f95bb83bdb43f0876166473b86e0d6
parent79a5e58e61e384a058a50c4b9f789851c3375846 (diff)
Simplify currentScreenbugfix/simplify-current-screen
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
-rw-r--r--src/gui/systray.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp
index 707609612..18259f27b 100644
--- a/src/gui/systray.cpp
+++ b/src/gui/systray.cpp
@@ -308,15 +308,11 @@ void Systray::forceWindowInit(QQuickWindow *window) const
QScreen *Systray::currentScreen() const
{
- const auto screens = QGuiApplication::screens();
- const auto cursorPos = QCursor::pos();
+ const auto screen = QGuiApplication::screenAt(QCursor::pos());
- for (const auto screen : screens) {
- if (screen->geometry().contains(cursorPos)) {
- return screen;
- }
+ if(screen) {
+ return screen;
}
-
// Didn't find anything matching the cursor position,
// falling back to the primary screen
return QGuiApplication::primaryScreen();