Commit 012d6408 authored by Alvin Wong's avatar Alvin Wong

Fix patch for Windows fullscreen mode hack

This fixes up e83e8779.
parent 80497587
From e9b40ddf98af52f1c1866c766c9add6245e66a92 Mon Sep 17 00:00:00 2001
From c09f43f4c97ab9154d35d9388943b5f58125e457 Mon Sep 17 00:00:00 2001
From: Alvin Wong <alvin@alvinhc.com>
Date: Thu, 18 Apr 2019 18:59:58 +0800
Subject: [PATCH] Hack to hide 1px border with OpenGL fullscreen hack
......@@ -8,13 +8,22 @@ leave the bottom border visible, which is probably the most we can do.
Ref: https://bugreports.qt.io/browse/QTBUG-41309
---
src/plugins/platforms/windows/qwindowswindow.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
src/plugins/platforms/windows/qwindowswindow.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 9705eb7293..08c743aaae 100644
index 9705eb7293..a25b11d305 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1558,7 +1558,7 @@ void QWindowsWindow::show_sys() const
restoreMaximize = true;
} else {
updateTransientParent();
- if (state & Qt::WindowMaximized) {
+ if (state & Qt::WindowMaximized && !(state & Qt::WindowFullScreen)) {
sm = SW_SHOWMAXIMIZED;
// Windows will not behave correctly when we try to maximize a window which does not
// have minimize nor maximize buttons in the window frame. Windows would then ignore
@@ -1995,7 +1995,7 @@ bool QWindowsWindow::isFullScreen_sys() const
return false;
QRect geometry = geometry_sys();
......@@ -24,12 +33,16 @@ index 9705eb7293..08c743aaae 100644
QPlatformScreen *screen = screenForGeometry(geometry);
return screen && geometry == screen->geometry();
}
@@ -2066,7 +2066,7 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState)
@@ -2066,7 +2066,11 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowStates newState)
const UINT swpf = SWP_FRAMECHANGED | SWP_NOACTIVATE;
const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
setFlag(SynchronousGeometryChangeEvent);
- SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.width(), r.height(), swpf);
+ if (testFlag(HasBorderInFullScreen)) {
+ SetWindowPos(m_data.hwnd, HWND_TOP, r.left() - 1, r.top() - 1, r.width() + 2, r.height() + 1, swpf);
+ } else {
+ SetWindowPos(m_data.hwnd, HWND_TOP, r.left(), r.top(), r.width(), r.height(), swpf);
+ }
if (!wasSync)
clearFlag(SynchronousGeometryChangeEvent);
clearFlag(MaximizeToFullScreen);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment