From: Kevin Ottens Date: Mon, 14 Sep 2020 16:22:56 +0000 (+0200) Subject: Use QGuiApplication::primaryScreen() as fallback for Systray::currentScreen() X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~170^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7ccb016397a3db9a128f491f752e14b947f73e46;p=nextcloud-desktop.git 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 --- diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index f8c827c5b..899cbf741 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