Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -390,11 +390,13 @@ glm::vec2 WindowScriptingInterface::getDeviceSize() const { · 389 unmodified lines | ||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | int WindowScriptingInterface::getX() { |
| 393 | − return qApp->getWindow()->x(); | |
| 393 | + return qApp->getWindow()->geometry().x(); | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | int WindowScriptingInterface::getY() { |
| 397 | − return qApp->getWindow()->y(); | |
| 397 | + auto menu = qApp->getPrimaryMenu(); | |
| 398 | + int menuHeight = menu ? menu->geometry().height() : 0; | |
| 399 | + return qApp->getWindow()->geometry().y() + menuHeight; | |
| 398 | 400 | } |
| 399 | 401 | |
| 400 | 402 | void WindowScriptingInterface::onWindowGeometryChanged(const QRect& windowGeometry) { |