Warning, /graphics/krita/3rdparty/ext_qt/0060-Windows-Add-a-default-setting-for-hasBorderInFullScr.patch is written in an unsupported language. File is not indexed.
0001 From 6c58e4bded4c5bc64a88d5f8c075861bb0c437b1 Mon Sep 17 00:00:00 2001 0002 From: Friedemann Kleint <Friedemann.Kleint@qt.io> 0003 Date: Wed, 21 Nov 2018 09:06:50 +0100 0004 Subject: [PATCH 20/47] Windows: Add a default setting for 0005 hasBorderInFullScreen 0006 0007 The hasBorderInFullScreen only has an effect when set before 0008 the window is shown or switched to fullscreen. This is currently 0009 not possible in the QML case since the window is only accessible 0010 after all properties (including visibility) have been set. 0011 Add a function to set a default value. 0012 0013 [ChangeLog][QtPlatformHeaders][QWindowsWindowFunctions] Add a default 0014 setting for hasBorderInFullScreen 0015 0016 Task-number: QTBUG-47247 0017 Task-number: QTBUG-71855 0018 Change-Id: I3952e3f34bc4eb134cf1c5265b4489fc74112688 0019 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> 0020 Reviewed-by: Andy Shaw <andy.shaw@qt.io> 0021 (cherry picked from commit 7264bf19dbc47b805bb7af5df584ce1aae081962) 0022 --- 0023 .../qwindowswindowfunctions.h | 9 +++++ 0024 .../qwindowswindowfunctions.qdoc | 33 +++++++++++++++++++ 0025 .../windows/qwindowsnativeinterface.cpp | 2 ++ 0026 .../platforms/windows/qwindowswindow.cpp | 8 ++++- 0027 .../platforms/windows/qwindowswindow.h | 2 ++ 0028 5 files changed, 53 insertions(+), 1 deletion(-) 0029 0030 diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h 0031 index e51c2fde67..032dcafa6e 100644 0032 --- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h 0033 +++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.h 0034 @@ -81,6 +81,15 @@ public: 0035 func(window, border); 0036 } 0037 0038 + typedef void (*SetHasBorderInFullScreenDefault)(bool border); 0039 + static const QByteArray setHasBorderInFullScreenDefaultIdentifier() { return QByteArrayLiteral("WindowsSetHasBorderInFullScreenDefault"); } 0040 + static void setHasBorderInFullScreenDefault(bool border) 0041 + { 0042 + auto func = reinterpret_cast<SetHasBorderInFullScreenDefault>(QGuiApplication::platformFunction(setHasBorderInFullScreenDefaultIdentifier())); 0043 + if (func) 0044 + func(border); 0045 + } 0046 + 0047 typedef void (*SetWindowActivationBehaviorType)(WindowActivationBehavior); 0048 static const QByteArray setWindowActivationBehaviorIdentifier() { return QByteArrayLiteral("WindowsSetWindowActivationBehavior"); } 0049 0050 diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc 0051 index a52bbe061b..0c52cde753 100644 0052 --- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc 0053 +++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc 0054 @@ -93,7 +93,40 @@ 0055 is true then it will enable the WS_BORDER flag in full screen mode to enable other top level windows 0056 inside the application to appear on top when required. 0057 0058 + \note The setting must be applied before showing the window or switching it 0059 + to full screen. For QML, setHasBorderInFullScreenDefault() can be used to 0060 + set a default value. 0061 + 0062 + See also \l [QtDoc] {Fullscreen OpenGL Based Windows} 0063 +*/ 0064 + 0065 +/*! 0066 + \typedef QWindowsWindowFunctions::SetHasBorderInFullScreenDefault 0067 + \since 5.13 0068 + 0069 + This is the typedef for the function returned by QGuiApplication::platformFunction 0070 + when passed setHasBorderInFullScreenDefaultIdentifier. 0071 +*/ 0072 + 0073 +/*! 0074 + \fn QByteArray QWindowsWindowFunctions::setHasBorderInFullScreenDefaultIdentifier() 0075 + \since 5.13 0076 + 0077 + This function returns the bytearray that can be used to query 0078 + QGuiApplication::platformFunction to retrieve the SetHasBorderInFullScreen function. 0079 +*/ 0080 + 0081 +/*! 0082 + \fn void QWindowsWindowFunctions::setHasBorderInFullScreenDefault(bool border) 0083 + \since 5.13 0084 + 0085 + This is a convenience function that can be used directly instead of resolving 0086 + the function pointer. \a border will be relayed to the function retrieved by 0087 + QGuiApplication. When \a border is true, the WS_BORDER flag will be set 0088 + in full screen mode for all windows by default. 0089 + 0090 See also \l [QtDoc] {Fullscreen OpenGL Based Windows} 0091 + \sa setHasBorderInFullScreen() 0092 */ 0093 0094 /*! 0095 diff --git a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp 0096 index 1c5be44150..42193baf46 100644 0097 --- a/src/plugins/platforms/windows/qwindowsnativeinterface.cpp 0098 +++ b/src/plugins/platforms/windows/qwindowsnativeinterface.cpp 0099 @@ -293,6 +293,8 @@ QFunctionPointer QWindowsNativeInterface::platformFunction(const QByteArray &fun 0100 return QFunctionPointer(QWindowsWindow::setTouchWindowTouchTypeStatic); 0101 if (function == QWindowsWindowFunctions::setHasBorderInFullScreenIdentifier()) 0102 return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenStatic); 0103 + if (function == QWindowsWindowFunctions::setHasBorderInFullScreenDefaultIdentifier()) 0104 + return QFunctionPointer(QWindowsWindow::setHasBorderInFullScreenDefault); 0105 if (function == QWindowsWindowFunctions::setWindowActivationBehaviorIdentifier()) 0106 return QFunctionPointer(QWindowsNativeInterface::setWindowActivationBehavior); 0107 if (function == QWindowsWindowFunctions::isTabletModeIdentifier()) 0108 diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp 0109 index 394486073a..4e3c7309a1 100644 0110 --- a/src/plugins/platforms/windows/qwindowswindow.cpp 0111 +++ b/src/plugins/platforms/windows/qwindowswindow.cpp 0112 @@ -1258,6 +1258,7 @@ void QWindowCreationContext::applyToMinMaxInfo(MINMAXINFO *mmi) const 0113 0114 const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"; 0115 const char *QWindowsWindow::hasBorderInFullScreenProperty = "_q_has_border_in_fullscreen"; 0116 +bool QWindowsWindow::m_borderInFullScreenDefault = false; 0117 0118 QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) : 0119 QWindowsBaseWindow(aWindow), 0120 @@ -1295,7 +1296,7 @@ QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) 0121 0122 if (aWindow->isTopLevel()) 0123 setWindowIcon(aWindow->icon()); 0124 - if (aWindow->property(hasBorderInFullScreenProperty).toBool()) 0125 + if (m_borderInFullScreenDefault || aWindow->property(hasBorderInFullScreenProperty).toBool()) 0126 setFlag(HasBorderInFullScreen); 0127 clearFlag(WithinCreate); 0128 } 0129 @@ -2965,6 +2966,11 @@ void QWindowsWindow::setHasBorderInFullScreenStatic(QWindow *window, bool border 0130 window->setProperty(hasBorderInFullScreenProperty, QVariant(border)); 0131 } 0132 0133 +void QWindowsWindow::setHasBorderInFullScreenDefault(bool border) 0134 +{ 0135 + m_borderInFullScreenDefault = border; 0136 +} 0137 + 0138 void QWindowsWindow::setHasBorderInFullScreen(bool border) 0139 { 0140 if (testFlag(HasBorderInFullScreen) == border) 0141 diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h 0142 index ce67e46df3..958564aa86 100644 0143 --- a/src/plugins/platforms/windows/qwindowswindow.h 0144 +++ b/src/plugins/platforms/windows/qwindowswindow.h 0145 @@ -340,6 +340,7 @@ public: 0146 static void setTouchWindowTouchTypeStatic(QWindow *window, QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes); 0147 void registerTouchWindow(QWindowsWindowFunctions::TouchWindowTouchTypes touchTypes = QWindowsWindowFunctions::NormalTouch); 0148 static void setHasBorderInFullScreenStatic(QWindow *window, bool border); 0149 + static void setHasBorderInFullScreenDefault(bool border); 0150 void setHasBorderInFullScreen(bool border); 0151 static QString formatWindowTitle(const QString &title); 0152 0153 @@ -385,6 +386,7 @@ private: 0154 // note: intentionally not using void * in order to avoid breaking x86 0155 VkSurfaceKHR m_vkSurface = 0; 0156 #endif 0157 + static bool m_borderInFullScreenDefault; 0158 }; 0159 0160 #ifndef QT_NO_DEBUG_STREAM 0161 -- 0162 2.20.1.windows.1 0163