diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index 707609612..263a91972 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -389,8 +389,9 @@ QRect Systray::taskbarGeometry() const return tbRect; #elif defined(Q_OS_MACOS) // Finder bar is always 22px height on macOS (when treating as effective pixels) - auto screenWidth = currentScreenRect().width(); - return {0, 0, screenWidth, 22}; + const auto screenWidth = currentScreenRect().width(); + const auto statusBarHeight = static_cast(OCC::statusBarThickness()); + return {0, 0, screenWidth, statusBarHeight}; #else if (taskbarOrientation() == TaskBarPosition::Bottom || taskbarOrientation() == TaskBarPosition::Top) { auto screenWidth = currentScreenRect().width(); diff --git a/src/gui/systray.h b/src/gui/systray.h index 31251d01e..6b63d6797 100644 --- a/src/gui/systray.h +++ b/src/gui/systray.h @@ -42,6 +42,7 @@ public: bool canOsXSendUserNotification(); void sendOsXUserNotification(const QString &title, const QString &message); void setTrayWindowLevelAndVisibleOnAllSpaces(QWindow *window); +double statusBarThickness(); #endif /** diff --git a/src/gui/systray.mm b/src/gui/systray.mm index a4d35eb23..544455c16 100644 --- a/src/gui/systray.mm +++ b/src/gui/systray.mm @@ -17,6 +17,11 @@ namespace OCC { +double statusBarThickness() +{ + return [NSStatusBar systemStatusBar].thickness; +} + bool canOsXSendUserNotification() { return NSClassFromString(@"NSUserNotificationCenter") != nil;