summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 159e1250d0..d639f27c1a 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1077,6 +1077,7 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w,
*/
const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle";
+const char *QWindowsWindow::hasBorderInFullScreenProperty = "_q_has_border_in_fullscreen";
QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) :
QWindowsBaseWindow(aWindow),
@@ -1115,6 +1116,8 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data)
if (aWindow->isTopLevel())
setWindowIcon(aWindow->icon());
+ if (aWindow->property(hasBorderInFullScreenProperty).toBool())
+ setFlag(HasBorderInFullScreen);
clearFlag(WithinCreate);
}
@@ -2662,15 +2665,26 @@ void QWindowsWindow::setHasBorderInFullScreenStatic(QWindow *window, bool border
if (QPlatformWindow *handle = window->handle())
static_cast<QWindowsWindow *>(handle)->setHasBorderInFullScreen(border);
else
- qWarning("%s invoked without window handle; call has no effect.", Q_FUNC_INFO);
+ window->setProperty(hasBorderInFullScreenProperty, QVariant(border));
}
void QWindowsWindow::setHasBorderInFullScreen(bool border)
{
+ if (testFlag(HasBorderInFullScreen) == border)
+ return;
if (border)
setFlag(HasBorderInFullScreen);
else
clearFlag(HasBorderInFullScreen);
+ // Directly apply the flag in case we are fullscreen.
+ if (m_windowState == Qt::WindowFullScreen) {
+ LONG_PTR style = GetWindowLongPtr(handle(), GWL_STYLE);
+ if (border)
+ style |= WS_BORDER;
+ else
+ style &= ~WS_BORDER;
+ SetWindowLongPtr(handle(), GWL_STYLE, style);
+ }
}
QString QWindowsWindow::formatWindowTitle(const QString &title)