WL 21664 - Window.innerHeight should not include the menu bar
Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -182,10 +182,6 @@ bool WindowScriptingInterface::isPointOnDesktopWindow(QVariant point) { · 181 unmodified lines | ||
| 182 | 182 | return offscreenUi->isPointOnDesktopWindow(point); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | −glm::vec2 WindowScriptingInterface::getDeviceSize() const { | |
| 186 | − return qApp->getDeviceSize(); | |
| 187 | −} | |
| 188 | − | |
| 189 | 185 | /// Makes sure that the reticle is visible, use this in blocking forms that require a reticle and |
| 190 | 186 | /// might be in same thread as a script that sets the reticle to invisible |
| 191 | 187 | void WindowScriptingInterface::ensureReticleVisible() const { |
| @@ -395,11 +391,15 @@ QString WindowScriptingInterface::checkVersion() { · 203 unmodified lines | ||
| 395 | 391 | } |
| 396 | 392 | |
| 397 | 393 | int WindowScriptingInterface::getInnerWidth() { |
| 398 | − return qApp->getWindow()->geometry().width(); | |
| 394 | + return qApp->getDeviceSize().x; | |
| 399 | 395 | } |
| 400 | 396 | |
| 401 | 397 | int WindowScriptingInterface::getInnerHeight() { |
| 402 | − return qApp->getWindow()->geometry().height(); | |
| 398 | + return qApp->getDeviceSize().y; | |
| 399 | +} | |
| 400 | + | |
| 401 | +glm::vec2 WindowScriptingInterface::getDeviceSize() const { | |
| 402 | + return qApp->getDeviceSize(); | |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | int WindowScriptingInterface::getX() { |