diff --git a/CHANGES b/CHANGES index d20924cce..4ea93c5c0 100644 --- a/CHANGES +++ b/CHANGES @@ -41,6 +41,7 @@ Misc: - Qt: Support switching webcams - Core: Add keysRead callback - Vita: Improved frame drawing speed + - Qt: Cap window size on start to monitor size 0.7.1: (2019-02-24) Bugfixes: diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index e669924bd..acf56669e 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -5,14 +5,15 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "Window.h" -#include #include #include #include #include #include #include +#include #include +#include #ifdef USE_SQLITE3 #include "ArchiveInspector.h" @@ -200,6 +201,15 @@ void Window::argumentsPassed(mArguments* args) { void Window::resizeFrame(const QSize& size) { QSize newSize(size); + if (windowHandle()) { + QRect geom = windowHandle()->screen()->availableGeometry(); + if (newSize.width() > geom.width()) { + newSize.setWidth(geom.width()); + } + if (newSize.height() > geom.height()) { + newSize.setHeight(geom.height()); + } + } m_screenWidget->setSizeHint(newSize); newSize -= m_screenWidget->size(); newSize += this->size(); @@ -595,7 +605,7 @@ void Window::showEvent(QShowEvent* event) { m_wasOpened = true; resizeFrame(m_screenWidget->sizeHint()); QVariant windowPos = m_config->getQtOption("windowPos"); - QRect geom = QApplication::desktop()->availableGeometry(this); + QRect geom = windowHandle()->screen()->availableGeometry(); if (!windowPos.isNull() && geom.contains(windowPos.toPoint())) { move(windowPos.toPoint()); } else {