Fix macOS popup y position, neglecting unneccesary calculations
authorDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
Sat, 4 Jan 2020 11:08:30 +0000 (12:08 +0100)
committerDominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
Sat, 4 Jan 2020 11:08:30 +0000 (12:08 +0100)
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
src/gui/systray.cpp

index aaf35a10b6e5546cfd5381c2c8cbc20c82a54808..2a98337279bd988f3c701450ae3ab552f03fbeec 100644 (file)
@@ -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