Use QGuiApplication::primaryScreen() as fallback for Systray::currentScreen()
authorKevin Ottens <kevin.ottens@nextcloud.com>
Mon, 14 Sep 2020 16:22:56 +0000 (18:22 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Tue, 15 Sep 2020 07:17:03 +0000 (07:17 +0000)
Under Wayland QCursor::pos() is unlikely to give us anything meaningful,
so fallback to the primary screen information.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/gui/systray.cpp

index f8c827c5b39f835a7c38354edcce3051c775c634..899cbf7415db005b59bbd3f32e0c43e2373de89b 100644 (file)
@@ -211,7 +211,9 @@ QScreen *Systray::currentScreen() const
         }
     }
 
-    return nullptr;
+    // Didn't find anything matching the cursor position,
+    // falling back to the primary screen
+    return QGuiApplication::primaryScreen();
 }
 
 Systray::TaskBarPosition Systray::taskbarOrientation() const