From 7ccb016397a3db9a128f491f752e14b947f73e46 Mon Sep 17 00:00:00 2001 From: Kevin Ottens Date: Mon, 14 Sep 2020 18:22:56 +0200 Subject: [PATCH] Use QGuiApplication::primaryScreen() as fallback for Systray::currentScreen() Under Wayland QCursor::pos() is unlikely to give us anything meaningful, so fallback to the primary screen information. Signed-off-by: Kevin Ottens --- src/gui/systray.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index f8c827c5b3..899cbf7415 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -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