diff --git a/src/gui/systray.cpp b/src/gui/systray.cpp index aaf35a10b..2a9833727 100644 --- a/src/gui/systray.cpp +++ b/src/gui/systray.cpp @@ -131,6 +131,11 @@ int Systray::calcTrayWindowX() } int Systray::calcTrayWindowY() { +#ifdef Q_OS_OSX + // macOS menu bar is always 22 (effective) pixels and at the top + // don't use availableGeometry() here, because this also excludes the dock + return 22+6; +#else #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) QScreen *trayScreen = QGuiApplication::screenAt(this->geometry().topRight()); #else @@ -157,7 +162,7 @@ int Systray::calcTrayWindowY() } } else { // tray icon is on the top - return (trayScreen->geometry().height() - trayScreen->availableGeometry().height()) + 6; +#endif } } } // namespace OCC