path: root/src/platformheaders
diff options
authorAndy Shaw <>2015-12-14 15:40:42 +0100
committerAndy Shaw <>2015-12-17 14:43:38 +0000
commit69839e55c13000ee9bf8d8e9d74b70096a92ae51 (patch)
tree1fa1dfa447c101af218c2c3349c643a548266a71 /src/platformheaders
parent4815f1cda42010659370ce2b80739a14d46ad21b (diff)
Windows: fix fullscreen OpenGL window issues with an opt-in function
Windows automatically disables DWM for opengl windows that have the exact dimensions of the primary screen. This causes numerous issues, such as menus and popups not showing up, and alt+tab misbehavior. Adding a one pixel border via WS_BORDER solves all of these issues. This is done by a QWindowsWindowFunctions to make it opt-in as turning it on can cause an unwanted change in the look of the window so it is up to the user to decide if they want this. [ChangeLog][Platform Specific Changes][Windows] Add a function to QWindowsWindowFunctions to enable working around a limitation with showing other top level windows when showing a fullscreen OpenGL based window. Task-number: QTBUG-41309 Task-number: QTBUG-41883 Task-number: QTBUG-42410 Change-Id: I8c5c785f5024737cd034b2b703671632a8102700 Reviewed-by: Laszlo Agocs <> Reviewed-by: Friedemann Kleint <>
Diffstat (limited to 'src/platformheaders')
2 files changed, 35 insertions, 0 deletions
diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h
index 4c6d01cc52..720f7f31be 100644
--- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h
+++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h
@@ -60,6 +60,15 @@ public:
if (func)
func(window, type);
+ typedef void (*SetHasBorderInFullScreen)(QWindow *window, bool border);
+ static const QByteArray setHasBorderInFullScreenIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreen"); }
+ static void setHasBorderInFullScreen(QWindow *window, bool border)
+ {
+ SetHasBorderInFullScreen func = reinterpret_cast<SetHasBorderInFullScreen>(QGuiApplication::platformFunction(setHasBorderInFullScreenIdentifier()));
+ if (func)
+ func(window, border);
+ }
diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc
index 84fae2f56d..d6b8764e7b 100644
--- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc
+++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc
@@ -69,3 +69,29 @@
This is a convenience function that can be used directly instead of resolving the function pointer.
\a window and \a type will be relayed to the function retrieved by QGuiApplication
+ \typedef QWindowsWindowFunctions::SetHasBorderInFullScreen
+ This is the typedef for the function returned by QGuiApplication::platformFunction when passed setHasBorderInFullScreenIdentifier.
+ \fn QByteArray QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier()
+ \since 5.6
+ This function returns the bytearray that can be used to query
+ QGuiApplication::platformFunction to retrieve the SetHasBorderInFullScreen function.
+ \fn void QWindowsWindowFunctions::setHasBorderInFullScreen(QWindow *window, bool border)
+ \since 5.6
+ This is a convenience function that can be used directly instead of resolving the function pointer.
+ \a window and \a border will be relayed to the function retrieved by QGuiApplication. When \a border
+ is true then it will enable the WS_BORDER flag in full screen mode to enable other top level windows
+ inside the application to appear on top when required.
+ See also \l [QtDoc] {Fullscreen OpenGL Based Windows}