4#include <QtCore/qt_windows.h>
8#if QT_CONFIG(draganddrop)
15#if QT_CONFIG(dynamicgl)
25#include <QtGui/qguiapplication.h>
26#include <QtGui/qscreen.h>
27#include <QtGui/qwindow.h>
28#include <QtGui/qregion.h>
29#include <QtGui/qopenglcontext.h>
30#include <private/qwindow_p.h>
31#include <private/qguiapplication_p.h>
32#include <private/qhighdpiscaling_p.h>
33#include <qpa/qwindowsysteminterface.h>
35#include <QtCore/qdebug.h>
36#include <QtCore/qlibraryinfo.h>
44#include <shellscalingapi.h>
65 if (style & WS_OVERLAPPED)
66 rc +=
" WS_OVERLAPPED";
67 if (style & WS_CLIPSIBLINGS)
68 rc +=
" WS_CLIPSIBLINGS";
69 if (style & WS_CLIPCHILDREN)
70 rc +=
" WS_CLIPCHILDREN";
71 if (style & WS_THICKFRAME)
72 rc +=
" WS_THICKFRAME";
73 if (style & WS_DLGFRAME)
75 if (style & WS_SYSMENU)
77 if (style & WS_MINIMIZEBOX)
78 rc +=
" WS_MINIMIZEBOX";
79 if (style & WS_MAXIMIZEBOX)
80 rc +=
" WS_MAXIMIZEBOX";
81 if (style & WS_BORDER)
83 if (style & WS_CAPTION)
85 if (style & WS_CHILDWINDOW)
86 rc +=
" WS_CHILDWINDOW";
87 if (style & WS_DISABLED)
91 if (style & WS_HSCROLL)
93 if (style & WS_ICONIC)
95 if (style & WS_MAXIMIZE)
97 if (style & WS_MINIMIZE)
99 if (style & WS_SIZEBOX)
101 if (style & WS_TABSTOP)
103 if (style & WS_TILED)
105 if (style & WS_VISIBLE)
107 if (style & WS_VSCROLL)
116 if (exStyle & WS_EX_TOOLWINDOW)
117 rc +=
" WS_EX_TOOLWINDOW";
118 if (exStyle & WS_EX_CONTEXTHELP)
119 rc +=
" WS_EX_CONTEXTHELP";
120 if (exStyle & WS_EX_LAYERED)
121 rc +=
" WS_EX_LAYERED";
122 if (exStyle & WS_EX_DLGMODALFRAME)
123 rc +=
" WS_EX_DLGMODALFRAME";
124 if (exStyle & WS_EX_LAYOUTRTL)
125 rc +=
" WS_EX_LAYOUTRTL";
126 if (exStyle & WS_EX_NOINHERITLAYOUT)
127 rc +=
" WS_EX_NOINHERITLAYOUT";
128 if (exStyle & WS_EX_ACCEPTFILES)
129 rc +=
" WS_EX_ACCEPTFILES";
130 if (exStyle & WS_EX_APPWINDOW)
131 rc +=
" WS_EX_APPWINDOW";
132 if (exStyle & WS_EX_CLIENTEDGE)
133 rc +=
" WS_EX_CLIENTEDGE";
134 if (exStyle & WS_EX_COMPOSITED)
135 rc +=
" WS_EX_COMPOSITED";
136 if (exStyle & WS_EX_CONTROLPARENT)
137 rc +=
" WS_EX_CONTROLPARENT";
138 if (exStyle & WS_EX_LEFT)
140 if (exStyle & WS_EX_LEFTSCROLLBAR)
141 rc +=
" WS_EX_LEFTSCROLLBAR";
142 if (exStyle & WS_EX_LTRREADING)
143 rc +=
" WS_EX_LTRREADING";
144 if (exStyle & WS_EX_MDICHILD)
145 rc +=
" WS_EX_MDICHILD";
146 if (exStyle & WS_EX_NOACTIVATE)
147 rc +=
" WS_EX_NOACTIVATE";
148 if (exStyle & WS_EX_NOPARENTNOTIFY)
149 rc +=
" WS_EX_NOPARENTNOTIFY";
150 if (exStyle & WS_EX_NOREDIRECTIONBITMAP)
151 rc +=
" WS_EX_NOREDIRECTIONBITMAP";
152 if (exStyle & WS_EX_RIGHT)
153 rc +=
" WS_EX_RIGHT";
154 if (exStyle & WS_EX_RIGHTSCROLLBAR)
155 rc +=
" WS_EX_RIGHTSCROLLBAR";
156 if (exStyle & WS_EX_RTLREADING)
157 rc +=
" WS_EX_RTLREADING";
158 if (exStyle & WS_EX_STATICEDGE)
159 rc +=
" WS_EX_STATICEDGE";
160 if (exStyle & WS_EX_TOPMOST)
161 rc +=
" WS_EX_TOPMOST";
162 if (exStyle & WS_EX_TRANSPARENT)
163 rc +=
" WS_EX_TRANSPARENT";
164 if (exStyle & WS_EX_WINDOWEDGE)
165 rc +=
" WS_EX_WINDOWEDGE";
173 if (
flags & SWP_FRAMECHANGED)
174 rc +=
" SWP_FRAMECHANGED";
175 if (
flags & SWP_HIDEWINDOW)
176 rc +=
" SWP_HIDEWINDOW";
177 if (
flags & SWP_NOACTIVATE)
178 rc +=
" SWP_NOACTIVATE";
179 if (
flags & SWP_NOCOPYBITS)
180 rc +=
" SWP_NOCOPYBITS";
181 if (
flags & SWP_NOMOVE)
183 if (
flags & SWP_NOOWNERZORDER)
184 rc +=
" SWP_NOOWNERZORDER";
185 if (
flags & SWP_NOREDRAW)
186 rc +=
" SWP_NOREDRAW";
187 if (
flags & SWP_NOSENDCHANGING)
188 rc +=
" SWP_NOSENDCHANGING";
189 if (
flags & SWP_NOSIZE)
191 if (
flags & SWP_NOZORDER)
192 rc +=
" SWP_NOZORDER";
193 if (
flags & SWP_SHOWWINDOW)
194 rc +=
" SWP_SHOWWINDOW";
195 if (
flags & SWP_ASYNCWINDOWPOS)
196 rc +=
" SWP_ASYNCWINDOWPOS";
197 if (
flags & SWP_DEFERERASE)
198 rc +=
" SWP_DEFERERASE";
199 if (
flags & SWP_DRAWFRAME)
200 rc +=
" SWP_DRAWFRAME";
201 if (
flags & SWP_NOREPOSITION)
202 rc +=
" SWP_NOREPOSITION";
210 if (
flags & WPF_SETMINPOSITION)
211 rc +=
" WPF_SETMINPOSITION";
212 if (
flags & WPF_RESTORETOMAXIMIZED)
213 rc +=
" WPF_RESTORETOMAXIMIZED";
214 if (
flags & WPF_ASYNCWINDOWPLACEMENT)
215 rc +=
" WPF_ASYNCWINDOWPLACEMENT";
225 if (cmd == SW_SHOWNORMAL)
226 rc +=
" SW_SHOWNORMAL";
227 if (cmd == SW_NORMAL)
229 if (cmd == SW_SHOWMINIMIZED)
230 rc +=
" SW_SHOWMINIMIZED";
231 if (cmd == SW_SHOWMAXIMIZED)
232 rc +=
" SW_SHOWMAXIMIZED";
233 if (cmd == SW_MAXIMIZE)
234 rc +=
" SW_MAXIMIZE";
235 if (cmd == SW_SHOWNOACTIVATE)
236 rc +=
" SW_SHOWNOACTIVATE";
239 if (cmd == SW_MINIMIZE)
240 rc +=
" SW_MINIMIZE";
241 if (cmd == SW_SHOWMINNOACTIVE)
242 rc +=
" SW_SHOWMINNOACTIVE";
243 if (cmd == SW_SHOWNA)
245 if (cmd == SW_RESTORE)
247 if (cmd == SW_SHOWDEFAULT)
248 rc +=
" SW_SHOWDEFAULT";
249 if (cmd == SW_FORCEMINIMIZE)
250 rc +=
" SW_FORCEMINIMIZE";
266 const int x =
rect.left();
267 const int y =
rect.top();
273#ifndef QT_NO_DEBUG_STREAM
278 d <<
"RECT(left=" <<
r.left <<
", top=" <<
r.top
279 <<
", right=" <<
r.right <<
", bottom=" <<
r.bottom
280 <<
" (" <<
r.right -
r.left <<
'x' <<
r.bottom -
r.top <<
"))";
288 d <<
"POINT(x=" <<
p.x <<
", y=" <<
p.y <<
')';
298 << wp.hwnd <<
", hwndInsertAfter=" << wp.hwndInsertAfter <<
", x=" << wp.x
299 <<
", y=" << wp.y <<
", cx=" << wp.cx <<
", cy=" << wp.cy <<
')';
307 d <<
"NCCALCSIZE_PARAMS(rgrc=[" <<
p.rgrc[0] <<
", " <<
p.rgrc[1] <<
", "
308 <<
p.rgrc[2] <<
"], lppos=" << *
p.lppos <<
')';
316 d <<
"MINMAXINFO(maxSize=" <<
i.ptMaxSize <<
", "
317 <<
"maxpos=" <<
i.ptMaxPosition <<
", "
318 <<
"maxtrack=" <<
i.ptMaxTrackSize <<
", "
319 <<
"mintrack=" <<
i.ptMinTrackSize <<
')';
330 <<
", ptMaxPosition=" << wp.ptMaxPosition <<
", rcNormalPosition="
331 << wp.rcNormalPosition <<
')';
346 for (
int i = 2;
i < 8; ++
i)
360 d <<
m.left() <<
", " <<
m.top() <<
", " <<
m.right() <<
", " <<
m.bottom();
367 if (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)
381 RECT
rect = { 0, 0, 0, 0 };
383 WINDOWPLACEMENT windowPlacement;
384 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
385 GetWindowPlacement(hwnd, &windowPlacement);
386 if (windowPlacement.showCmd == SW_SHOWMINIMIZED) {
391 GetWindowRect(hwnd, &
rect);
392 const HWND
parent = GetParent(hwnd);
393 if (
parent && !topLevel) {
396 POINT leftTop = {
rect.left,
rect.top };
398 rect.left = leftTop.x;
399 rect.top = leftTop.y;
409 if (!IsWindowVisible(hwnd))
410 return QWindow::Hidden;
411 WINDOWPLACEMENT windowPlacement;
412 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
413 if (GetWindowPlacement(hwnd, &windowPlacement)) {
414 switch (windowPlacement.showCmd) {
415 case SW_SHOWMINIMIZED:
417 case SW_FORCEMINIMIZE:
418 return QWindow::Minimized;
419 case SW_SHOWMAXIMIZED:
420 return QWindow::Maximized;
425 return QWindow::Windowed;
430 switch (
w->surfaceType()) {
446 DWM_BLURBEHIND blurBehind = {0, 0,
nullptr, 0};
448 blurBehind.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION;
449 blurBehind.fEnable = TRUE;
450 blurBehind.hRgnBlur = CreateRectRgn(0, 0, -1, -1);
452 const bool result = DwmEnableBlurBehindWindow(hwnd, &blurBehind) == S_OK;
454 if (blurBehind.hRgnBlur)
455 DeleteObject(blurBehind.hRgnBlur);
476 const LONG_PTR
exStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
482 SetWindowLongPtr(hwnd, GWL_EXSTYLE,
exStyle | WS_EX_LAYERED);
484 SetWindowLongPtr(hwnd, GWL_EXSTYLE,
exStyle & ~WS_EX_LAYERED);
496 BLENDFUNCTION blend = {AC_SRC_OVER, 0,
alpha, AC_SRC_ALPHA};
497 UpdateLayeredWindow(hwnd,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr, 0, &blend, ULW_ALPHA);
499 SetLayeredWindowAttributes(hwnd, 0,
alpha, LWA_ALPHA);
501 }
else if (IsWindowVisible(hwnd)) {
502 InvalidateRect(hwnd,
nullptr, TRUE);
509 const bool hasAlpha =
w->format().hasAlpha();
522 return GetSystemMetricsForDpi(SM_CXSIZEFRAME, dpi)
523 + GetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi);
533 POINT pt = {screenPoint.
x(), screenPoint.
y()};
534 if (HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL)) {
537 if (SUCCEEDED(GetDpiForMonitor(hMonitor, MDT_EFFECTIVE_DPI, &dpiX, &dpiY))) {
547 const UINT dpi = GetDpiForWindow(hwnd);
608 debug <<
"WindowCreationData: " <<
d.flags
609 <<
"\n topLevel=" <<
d.topLevel;
611 debug <<
" parent=" <<
d.parentHandle;
612 debug <<
" popup=" <<
d.popup <<
" dialog=" <<
d.dialog
613 <<
" embedded=" <<
d.embedded <<
" tool=" <<
d.tool
624 flags &=
~Qt::WindowFullscreenButtonHint;
645 return s->
data().deviceName;
649 if (winScreen && getDeviceName(winScreen) !=
name) {
686 const QScreen *orgScreen =
nullptr;
707 if (orgGeo.
center() == (orgFrame - margins).center())
713 const QPoint newPosNoMargin(newPos.
x() - invMargins.
left(), newPos.
y() - invMargins.
top());
715 return scrGeo.
contains(newPosNoMargin) ? newPosNoMargin : newPos;
719 unsigned creationFlags)
772 exStyle |= WS_EX_LAYOUTRTL | WS_EX_NOINHERITLAYOUT;
789 style = WS_OVERLAPPED;
796 style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN ;
803 style |= WS_DLGFRAME;
805 style |= WS_THICKFRAME;
813 style |= WS_SYSMENU | WS_BORDER;
814 exStyle |= WS_EX_DLGMODALFRAME;
817 if (showMinimizeButton)
818 style |= WS_MINIMIZEBOX;
820 if (showMaximizeButton)
821 style |= WS_MAXIMIZEBOX;
822 if (showMinimizeButton || showMaximizeButton)
827 && !showMaximizeButton)
836 exStyle |= WS_EX_LAYERED | WS_EX_TRANSPARENT;
840 exStyle |= WS_EX_NOREDIRECTIONBITMAP;
855 const QPalette windowPal = dWindow->windowPalette();
866 const auto appinst =
reinterpret_cast<HINSTANCE
>(GetModuleHandle(
nullptr));
878 const auto *titleUtf16 =
reinterpret_cast<const wchar_t *
>(
title.
utf16());
879 const auto *classNameUtf16 =
reinterpret_cast<const wchar_t *
>(
windowClassName.utf16());
888 const bool hasFrame = (
style & (WS_DLGFRAME | WS_THICKFRAME))
895 <<
'\n' << *
this <<
"\nrequested: " <<
rect <<
": "
898 <<
" custom margins: " <<
context->customMargins
899 <<
" invisible margins: " << invMargins;
905 int mirrorParentWidth = 0;
909 mirrorParentWidth =
rect.right;
911 if (mirrorParentWidth != 0 &&
pos.x() != CW_USEDEFAULT &&
context->frameWidth != CW_USEDEFAULT)
914 result.hwnd = CreateWindowEx(
exStyle, classNameUtf16, titleUtf16,
920 <<
"CreateWindowEx: returns " <<
w <<
' ' <<
result.hwnd <<
" obtained geometry: "
931 if (mirrorParentWidth != 0) {
932 context->obtainedPos.setX(mirrorParentWidth -
context->obtainedSize.width()
938 result.geometry = obtainedGeometry;
940 result.preMoveGeometry = obtainedGeometry;
943 result.hasFrame = hasFrame;
952 const LONG_PTR oldStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
953 const LONG_PTR oldExStyle = GetWindowLongPtr(hwnd, GWL_EXSTYLE);
955 const LONG_PTR newStyle =
style | (oldStyle & (WS_DISABLED|WS_VISIBLE));
956 if (oldStyle != newStyle)
957 SetWindowLongPtr(hwnd, GWL_STYLE, newStyle);
958 const LONG_PTR newExStyle =
exStyle;
959 if (newExStyle != oldExStyle)
960 SetWindowLongPtr(hwnd, GWL_EXSTYLE, newExStyle);
961 qCDebug(lcQpaWindow).nospace() << __FUNCTION__ << hwnd << *
this
962 <<
"\n Style from " <<
debugWinStyle(DWORD(oldStyle)) <<
"\n to "
972 UINT swpFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER;
974 swpFlags |= SWP_FRAMECHANGED;
976 swpFlags |= SWP_NOACTIVATE;
978 SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, swpFlags);
980 qWarning(
"QWidget: Incompatible window flags: the window can't be on top and on bottom at the same time");
982 SetWindowPos(hwnd, HWND_BOTTOM, 0, 0, 0, 0, swpFlags);
983 }
else if (frameChange) {
984 SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, swpFlags);
987 HMENU systemMenu = GetSystemMenu(hwnd, FALSE);
989 EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_ENABLED);
991 EnableMenuItem(systemMenu, SC_CLOSE, MF_BYCOMMAND|MF_GRAYED);
995 SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, swpFlags);
1029 RECT
rect = {0,0,0,0};
1030 style &= ~DWORD(WS_OVERLAPPED);
1031 if (AdjustWindowRectEx(&
rect, style, FALSE, exStyle) == FALSE)
1032 qErrnoWarning(
"%s: AdjustWindowRectEx failed", __FUNCTION__);
1035 qCDebug(lcQpaWindow).nospace() << __FUNCTION__ <<
" style="
1046 DWORD(GetWindowLongPtr(hwnd, GWL_EXSTYLE)));
1053 RECT
rect = {0,0,0,0};
1054 style &= ~DWORD(WS_OVERLAPPED);
1055 if (AdjustWindowRectExForDpi(&
rect, style, FALSE, exStyle,
unsigned(
qRound(dpi))) == FALSE) {
1056 qErrnoWarning(
"%s: AdjustWindowRectExForDpi failed", __FUNCTION__);
1060 qCDebug(lcQpaWindow).nospace() << __FUNCTION__ <<
" style="
1074 auto screen = screenManager.screenForHwnd(hwnd);
1076 screen = screenManager.screens().value(0);
1078 return frame(
w, style, exStyle, dpi);
1085 return frame(
w, hwnd, DWORD(GetWindowLongPtr(hwnd, GWL_STYLE)),
1086 DWORD(GetWindowLongPtr(hwnd, GWL_EXSTYLE)));
1091 DWORD style, DWORD exStyle)
1101 auto screen = screenManager.screenAtDp(geometry.
center());
1103 screen = screenManager.screens().value(0);
1105 dpi =
screen->logicalDpi().first;
1112 if (!msg.wParam || customMargins.
isNull())
1114 *
result = DefWindowProc(msg.hwnd, msg.message, msg.wParam, msg.lParam);
1115 auto *ncp =
reinterpret_cast<NCCALCSIZE_PARAMS *
>(msg.lParam);
1116 const RECT oldClientArea = ncp->rgrc[0];
1117 ncp->rgrc[0].left += customMargins.
left();
1118 ncp->rgrc[0].top += customMargins.
top();
1119 ncp->rgrc[0].right -= customMargins.
right();
1120 ncp->rgrc[0].bottom -= customMargins.
bottom();
1122 qCDebug(lcQpaWindow).nospace() << __FUNCTION__ << oldClientArea <<
'+' << customMargins <<
"-->"
1123 << ncp->rgrc[0] <<
' ' << ncp->rgrc[1] <<
' ' << ncp->rgrc[2]
1124 <<
' ' << ncp->lppos->cx <<
',' << ncp->lppos->cy;
1135 const int maximumWidth =
qMax(maximumSize->
width(), minimumSize->
width());
1136 const int maximumHeight =
qMax(maximumSize->
height(), minimumSize->
height());
1137 const int frameWidth = margins.
left() + margins.
right();
1138 const int frameHeight = margins.
top() + margins.
bottom();
1140 if (minimumSize->
width() > 0)
1141 minimumSize->
rwidth() += frameWidth;
1142 if (minimumSize->
height() > 0)
1143 minimumSize->
rheight() += frameHeight;
1145 maximumSize->
setWidth(maximumWidth + frameWidth);
1147 maximumSize->
setHeight(maximumHeight + frameHeight);
1158 qCDebug(lcQpaWindow).nospace() <<
'>' << __FUNCTION__ <<
'<' <<
" min="
1159 << minimumSize.
width() <<
',' << minimumSize.
height()
1160 <<
" max=" << maximumSize.
width() <<
',' << maximumSize.
height()
1161 <<
" margins=" << margins
1164 if (minimumSize.
width() > 0)
1165 mmi->ptMinTrackSize.x = minimumSize.
width();
1166 if (minimumSize.
height() > 0)
1167 mmi->ptMinTrackSize.y = minimumSize.
height();
1170 mmi->ptMaxTrackSize.x = maximumSize.
width();
1172 mmi->ptMaxTrackSize.y = maximumSize.
height();
1173 qCDebug(lcQpaWindow).nospace() <<
'<' << __FUNCTION__ <<
" out " << *mmi;
1208 return (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYOUTRTL) != 0;
1223 return bw ? bw->
handle() : HWND(
nullptr);
1247std::optional<QWindowsBaseWindow::TouchWindowTouchTypes>
1250 ULONG touchFlags = 0;
1251 if (IsTouchWindow(
handle(), &touchFlags) == FALSE)
1254 if ((touchFlags & TWF_FINETOUCH) != 0)
1255 result.setFlag(TouchWindowTouchType::FineTouch);
1256 if ((touchFlags & TWF_WANTPALM) != 0)
1257 result.setFlag(TouchWindowTouchType::WantPalmTouch);
1263 SetWindowPos(
handle(),
nullptr , 0, 0, 0, 0,
1264 SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
1274 SetWindowPos(
handle(), HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1282 SetWindowPos(
handle(), HWND_BOTTOM, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
1344 , m_topLevelStyle(0)
1351 const HWND newParent = newParentWindow ?
reinterpret_cast<HWND
>(newParentWindow->
winId()) : HWND(
nullptr);
1353 const DWORD oldStyle =
style();
1354 qCDebug(lcQpaWindow) << __FUNCTION__ <<
window() <<
"newParent="
1355 << newParentWindow << newParent <<
"oldStyle=" <<
debugWinStyle(oldStyle);
1356 SetParent(m_hwnd, newParent);
1358 DWORD newStyle = oldStyle;
1360 newStyle = m_topLevelStyle;
1362 m_topLevelStyle = oldStyle;
1363 newStyle &= ~(WS_OVERLAPPEDWINDOW | WS_POPUPWINDOW);
1364 newStyle |= WS_CHILD;
1366 SetWindowLongPtr(m_hwnd, GWL_STYLE, newStyle);
1372 qCDebug(lcQpaWindow) << __FUNCTION__ <<
window() << visible;
1374 ShowWindow(
handle(), SW_SHOWNOACTIVATE);
1400 const QRect &geometryIn,
const QRect &geometry,
1402 DWORD style, DWORD exStyle) :
1405 requestedGeometryIn(geometryIn),
1406 requestedGeometry(geometry),
1407 obtainedPos(geometryIn.topLeft()),
1408 obtainedSize(geometryIn.
size()),
1430 const bool isDefaultPosition = !
frameX && !
frameY &&
w->isTopLevel();
1437 qCDebug(lcQpaWindow).nospace()
1438 << __FUNCTION__ <<
' ' <<
w <<
' ' << geometry
1473bool QWindowsWindow::m_borderInFullScreenDefault =
false;
1474bool QWindowsWindow::m_inSetgeometry =
false;
1481 , m_vkSurface(VK_NULL_HANDLE)
1490#if QT_CONFIG(opengl)
1494#if QT_CONFIG(vulkan)
1511 if (aWindow->isTopLevel())
1522 UnregisterTouchWindow(m_data.
hwnd);
1542 if (obtainedScreen &&
screen() != obtainedScreen)
1543 QWindowSystemInterface::handleWindowScreenChanged<QWindowSystemInterface::SynchronousDelivery>(
w, obtainedScreen->
screen());
1546 QWindowSystemInterface::handleGeometryChange<QWindowSystemInterface::SynchronousDelivery>(
w, obtainedGeometry);
1554 return window()->requestedFormat();
1557void QWindowsWindow::fireExpose(
const QRegion ®ion,
bool force)
1559 if (region.
isEmpty() && !force)
1566void QWindowsWindow::fireFullExpose(
bool force)
1571void QWindowsWindow::destroyWindow()
1579 if (
w->transientParent() ==
window()) {
1581 tw->updateTransientParent();
1586 context->clearWindowUnderMouse();
1589 setDropSiteEnabled(
false);
1590#if QT_CONFIG(vulkan)
1595 m_vkSurface = VK_NULL_HANDLE;
1601 staticOpenGLContext->destroyWindowSurface(m_surface);
1602 m_surface =
nullptr;
1605 DestroyWindow(m_data.
hwnd);
1607 m_data.
hwnd =
nullptr;
1611void QWindowsWindow::updateDropSite(
bool topLevel)
1614 bool parentIsEmbedded =
false;
1621 parentIsEmbedded =
true;
1624 if (topLevel || parentIsEmbedded) {
1641void QWindowsWindow::setDropSiteEnabled(
bool dropEnabled)
1643 if (isDropSiteEnabled() == dropEnabled)
1645 qCDebug(lcQpaMime) << __FUNCTION__ <<
window() << dropEnabled;
1646#if QT_CONFIG(clipboard) && QT_CONFIG(draganddrop)
1650 RegisterDragDrop(m_data.
hwnd, m_dropTarget);
1651 CoLockObjectExternal(m_dropTarget,
true,
true);
1653 CoLockObjectExternal(m_dropTarget,
false,
true);
1655 RevokeDragDrop(m_data.
hwnd);
1656 m_dropTarget =
nullptr;
1661bool QWindowsWindow::m_screenForGLInitialized =
false;
1665 m_screenForGLInitialized =
false;
1670 m_screenForGLInitialized =
false;
1676 if (!m_screenForGLInitialized) {
1678 m_screenForGLInitialized =
true;
1692 if (ww->isEmbedded()) {
1693 HWND parentHWND = GetAncestor(ww->handle(), GA_PARENT);
1694 const HWND desktopHwnd = GetDesktopWindow();
1696 while (parentHWND && parentHWND != desktopHwnd) {
1699 parentHWND = GetAncestor(parentHWND, GA_PARENT);
1722 qCDebug(lcQpaWindow) << __FUNCTION__ <<
this <<
win << m_data.
hwnd << visible;
1736 SetForegroundWindow(m_data.
hwnd);
1741 ShowWindow(m_data.
hwnd, SW_HIDE);
1751 return m_data.
hwnd && IsWindowVisible(m_data.
hwnd);
1757 if (
const HWND activeHwnd = GetForegroundWindow())
1758 if (m_data.
hwnd == activeHwnd || IsChild(activeHwnd, m_data.
hwnd))
1766 return IsChild(m_data.
hwnd, childWindow->handle());
1789#ifndef GWL_HWNDPARENT
1790# define GWL_HWNDPARENT (-8)
1793void QWindowsWindow::updateTransientParent()
const
1798 const HWND oldTransientParent = GetWindow(m_data.
hwnd, GW_OWNER);
1799 HWND newTransientParent =
nullptr;
1803 newTransientParent = tw->handle();
1807 while (newTransientParent && (GetWindowLongPtr(newTransientParent, GWL_STYLE) & WS_CHILD) != 0)
1808 newTransientParent = GetParent(newTransientParent);
1810 if (newTransientParent != oldTransientParent)
1817 const QVariant showWithoutActivating =
window->property(
"_q_showWithoutActivating");
1818 return showWithoutActivating.
isValid() && showWithoutActivating.
toBool();
1823 WINDOWPLACEMENT windowPlacement;
1824 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
1825 if (GetWindowPlacement(hwnd, &windowPlacement)) {
1826 windowPlacement.showCmd = SW_SHOWMINIMIZED;
1828 SetWindowPlacement(hwnd, &windowPlacement);
1835 WINDOWPLACEMENT windowPlacement;
1836 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
1837 if (GetWindowPlacement(hwnd, &windowPlacement)) {
1839 windowPlacement.flags |= WPF_RESTORETOMAXIMIZED;
1841 windowPlacement.flags &= ~WPF_RESTORETOMAXIMIZED;
1842 SetWindowPlacement(hwnd, &windowPlacement);
1847void QWindowsWindow::show_sys()
const
1849 int sm = SW_SHOWNORMAL;
1850 bool fakedMaximize =
false;
1851 bool restoreMaximize =
false;
1853 const Qt::WindowFlags
flags =
w->flags();
1855 if (
w->isTopLevel()) {
1856 const Qt::WindowStates
state =
w->windowStates();
1858 sm = SW_SHOWMINIMIZED;
1860 sm = SW_SHOWMINNOACTIVE;
1862 restoreMaximize =
true;
1864 updateTransientParent();
1866 sm = SW_SHOWMAXIMIZED;
1874 fakedMaximize = TRUE;
1881 sm = SW_SHOWNOACTIVATE;
1886 ShowWindow(m_data.
hwnd, sm);
1890 if (fakedMaximize) {
1892 SetWindowPos(m_data.
hwnd,
nullptr, 0, 0, 0, 0,
1893 SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER
1894 | SWP_FRAMECHANGED);
1896 if (restoreMaximize)
1902 qCDebug(lcQpaWindow) << __FUNCTION__ <<
window() << newParent;
1905 setParent_sys(newParent);
1912 HWND newParentHWND =
nullptr;
1915 newParentHWND = parentW->
handle();
1920 HWND desktopHwnd = GetDesktopWindow();
1921 if (oldParentHWND == desktopHwnd)
1922 oldParentHWND =
nullptr;
1923 if (newParentHWND == desktopHwnd)
1924 newParentHWND =
nullptr;
1926 if (newParentHWND != oldParentHWND) {
1927 const bool wasTopLevel = oldParentHWND ==
nullptr;
1928 const bool isTopLevel = newParentHWND ==
nullptr;
1931 SetParent(m_data.
hwnd, newParentHWND);
1938 setDropSiteEnabled(
false);
1956 &&
w->format().hasAlpha())
1975 const UINT dpi = UINT(wParam);
1996 const UINT dpi = HIWORD(wParam);
2002 if (!IsZoomed(hwnd))
2021 if (!m_inSetgeometry) {
2023 const auto prcNewWindow =
reinterpret_cast<RECT *
>(lParam);
2024 SetWindowPos(hwnd,
nullptr, prcNewWindow->left, prcNewWindow->top,
2025 prcNewWindow->right - prcNewWindow->left,
2026 prcNewWindow->bottom - prcNewWindow->top, SWP_NOZORDER | SWP_NOACTIVATE);
2031 handleGeometryChange();
2041 const UINT dpi = GetDpiForWindow(hwnd);
2057 wp.length =
sizeof(WINDOWPLACEMENT);
2058 if (GetWindowPlacement(hwnd, &wp)) {
2068 const bool fakeFullScreen =
2071 const QMargins margins = fakeFullScreen
2078 const QRect &requestedRect,
2079 const QRect &obtainedRect,
2088 debug <<
"Unable to set geometry ";
2090 debug <<
" (frame: ";
2092 debug <<
") on " <<
window->metaObject()->className() <<
"/\""
2093 <<
window->objectName() <<
"\" on \"" <<
window->screen()->name()
2094 <<
"\". Resulting geometry: ";
2096 debug <<
" (frame: ";
2098 debug <<
") margins: ";
2100 if (!customMargins.
isNull()) {
2101 debug <<
" custom margin: ";
2104 const auto minimumSize =
window->minimumSize();
2105 const bool hasMinimumSize = !minimumSize.isEmpty();
2107 debug <<
" minimum size: " << minimumSize.width() <<
'x' << minimumSize.height();
2108 const auto maximumSize =
window->maximumSize();
2111 debug <<
" maximum size: " << maximumSize.width() <<
'x' << maximumSize.height();
2112 if (hasMinimumSize || hasMaximumSize) {
2113 MINMAXINFO minmaxInfo;
2114 memset(&minmaxInfo, 0,
sizeof(minmaxInfo));
2116 debug <<
' ' << minmaxInfo;
2147 const auto warning =
2159 while (
QWindow *transientParent =
w->transientParent())
2160 w = transientParent;
2174 if (
w->transientParent() == currentWindow &&
w != currentWindow &&
w->isVisible()) {
2178 GetWindowRect(transientChild->
handle(), &oldChildPos);
2187 scale * (oldChildPos.top - oldParentPos.top), 0, 0));
2189 const RECT newChildPos { newParentPos.left +
offset.left,
2190 newParentPos.top +
offset.top,
2194 SetWindowPos(transientChild->
handle(),
nullptr, newChildPos.left, newChildPos.top,
2195 newChildPos.right, newChildPos.bottom, SWP_NOZORDER | SWP_NOACTIVATE);
2205 handleGeometryChange();
2214 && IsZoomed(m_data.
hwnd)) {
2215 const int resizedWidth = LOWORD(lParam);
2216 const int resizedHeight = HIWORD(lParam);
2218 const HMONITOR monitor = MonitorFromWindow(m_data.
hwnd, MONITOR_DEFAULTTOPRIMARY);
2219 MONITORINFO monitorInfo = {};
2220 monitorInfo.cbSize =
sizeof(MONITORINFO);
2221 GetMonitorInfoW(monitor, &monitorInfo);
2223 int correctLeft = monitorInfo.rcMonitor.left;
2224 int correctTop = monitorInfo.rcMonitor.top;
2225 int correctWidth = monitorInfo.rcWork.right - monitorInfo.rcWork.left;
2226 int correctHeight = monitorInfo.rcWork.bottom - monitorInfo.rcWork.top;
2230 correctLeft -= borderWidth;
2231 correctTop -= borderWidth;
2232 correctWidth += borderWidth * 2;
2233 correctHeight += borderWidth * 2;
2236 if (resizedWidth != correctWidth || resizedHeight != correctHeight) {
2237 qCDebug(lcQpaWindow) << __FUNCTION__ <<
"correcting: " << resizedWidth <<
"x"
2238 << resizedHeight <<
" -> " << correctWidth <<
"x" << correctHeight;
2239 SetWindowPos(m_data.
hwnd,
nullptr, correctLeft, correctTop, correctWidth, correctHeight,
2240 SWP_NOZORDER | SWP_NOACTIVATE);
2248 case SIZE_MINIMIZED:
2252 case SIZE_MAXIMIZED:
2253 handleGeometryChange();
2259 handleGeometryChange();
2261 if (isFullScreen_sys())
2262 handleWindowStateChange(
2287 if (newScreen ==
nullptr || newScreen == currentScreen)
2295 qCDebug(lcQpaWindow).noquote().nospace() << __FUNCTION__
2296 <<
' ' <<
window() <<
" \"" << (currentScreen ? currentScreen->
name() :
QString())
2297 <<
"\"->\"" << newScreen->
name() <<
'"';
2299 QWindowSystemInterface::handleWindowScreenChanged<QWindowSystemInterface::SynchronousDelivery>(
window(), newScreen->
screen());
2302void QWindowsWindow::handleGeometryChange()
2314 fireFullExpose(
true);
2338 << margins <<
" to " <<
rect
2342 const HWND hwnd =
handle();
2343 WINDOWPLACEMENT windowPlacement;
2344 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
2345 GetWindowPlacement(hwnd, &windowPlacement);
2348 if ((windowPlacement.showCmd == SW_MAXIMIZE && !IsWindowVisible(hwnd))
2349 || windowPlacement.showCmd == SW_SHOWMINIMIZED) {
2350 windowPlacement.rcNormalPosition =
2352 windowPlacement.showCmd = windowPlacement.showCmd == SW_SHOWMINIMIZED ? SW_SHOWMINIMIZED : SW_HIDE;
2353 result = SetWindowPlacement(hwnd, &windowPlacement);
2357 const HWND parentHandle = GetParent(hwnd);
2360 GetClientRect(parentHandle, &
rect);
2383 SetLayout(m_hdc, 0);
2398 ReleaseDC(
handle(), m_hdc);
2405#if QT_CONFIG(dynamicgl)
2414 WPARAM, LPARAM, LRESULT *
result)
2416 if (
message == WM_ERASEBKGND) {
2421 if (!
window()->
isVisible() && (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) != 0)
2424 if (!GetUpdateRect(m_data.
hwnd, 0, FALSE))
2431 InvalidateRect(hwnd,
nullptr,
false);
2433 BeginPaint(hwnd, &ps);
2442 EndPaint(hwnd, &ps);
2453 qCDebug(lcQpaWindow) <<
'>' << __FUNCTION__ <<
this <<
window() <<
"\n from: "
2459 m_data = setWindowFlags_sys(
flags);
2468 if (oldGeometry != newGeometry)
2469 handleGeometryChange();
2471 qCDebug(lcQpaWindow) <<
'<' << __FUNCTION__ <<
"\n returns: "
2472 << m_data.
flags <<
" geometry " << oldGeometry <<
"->" << newGeometry;
2476 unsigned flags)
const
2486 result.hasFrame = (creationData.
style & (WS_DLGFRAME | WS_THICKFRAME))
2491void QWindowsWindow::handleWindowStateChange(Qt::WindowStates
state)
2494 <<
"\n from " << m_windowState <<
" to " <<
state;
2495 m_windowState =
state;
2502 WINDOWPLACEMENT windowPlacement{};
2503 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
2504 GetWindowPlacement(m_data.
hwnd, &windowPlacement);
2506 windowPlacement.rcNormalPosition =
geometry;
2507 SetWindowPlacement(m_data.
hwnd, &windowPlacement);
2512 bool exposeEventsSent =
false;
2515 exposeEventsSent =
true;
2521 if (platformWindow && platformWindow->
isLayered()) {
2522 platformWindow->fireFullExpose();
2523 exposeEventsSent =
true;
2540 setWindowState_sys(
state);
2541 m_windowState =
state;
2545bool QWindowsWindow::isFullScreen_sys()
const
2548 if (!
w->isTopLevel())
2568void QWindowsWindow::setWindowState_sys(Qt::WindowStates
newState)
2570 const Qt::WindowStates oldState = m_windowState;
2573 qCDebug(lcQpaWindow) <<
'>' << __FUNCTION__ <<
this <<
window()
2574 <<
" from " << oldState <<
" to " <<
newState;
2577 auto stateChange = oldState ^
newState;
2581 UINT newStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_POPUP;
2585 if (!m_savedStyle) {
2586 m_savedStyle =
style();
2590 m_savedFrameGeometry = nf;
2597 if (m_savedStyle & WS_SYSMENU)
2598 newStyle |= WS_SYSMENU;
2600 newStyle |= WS_VISIBLE;
2602 newStyle |= WS_BORDER;
2616 const UINT swpf = SWP_FRAMECHANGED | SWP_NOACTIVATE;
2619 SetWindowPos(m_data.
hwnd, HWND_TOP,
r.left(),
r.top(),
r.width(),
r.height(), swpf);
2628 unsigned newStyle = m_savedStyle ? m_savedStyle :
style();
2630 newStyle |= WS_VISIBLE;
2637 if (
const auto platformScreen =
screen->handle()) {
2638 if (!platformScreen->geometry().intersects(m_savedFrameGeometry))
2639 m_savedFrameGeometry.
moveTo(platformScreen->geometry().topLeft());
2647 UINT swpf = SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE;
2648 if (!m_savedFrameGeometry.
isValid())
2649 swpf |= SWP_NOSIZE | SWP_NOMOVE;
2655 ShowWindow(m_data.
hwnd, SW_SHOWNOACTIVATE);
2656 SetWindowPos(m_data.
hwnd,
nullptr, m_savedFrameGeometry.
x(), m_savedFrameGeometry.
y(),
2657 m_savedFrameGeometry.
width(), m_savedFrameGeometry.
height(), swpf);
2663 ShowWindow(m_data.
hwnd,
2669 m_savedFrameGeometry =
QRect();
2676 ShowWindow(m_data.
hwnd,
2688 ShowWindow(m_data.
hwnd,
2702 SetWindowLongPtr(m_data.
hwnd, GWL_STYLE,
s);
2709 SetWindowLongPtr(m_data.
hwnd, GWL_EXSTYLE,
s);
2714 switch (
event->type()) {
2742 auto *windowPos =
reinterpret_cast<WINDOWPOS *
>(
message->lParam);
2746 windowPos->flags |= SWP_NOCOPYBITS;
2748 if ((windowPos->flags & SWP_NOZORDER) == 0) {
2750 QWindow *parentWindow = qWindow->parent();
2751 HWND parentHWND = GetAncestor(windowPos->hwnd, GA_PARENT);
2752 HWND desktopHWND = GetDesktopWindow();
2753 platformWindow->m_data.
embedded = !parentWindow && parentHWND && (parentHWND != desktopHWND);
2756 windowPos->hwndInsertAfter = HWND_BOTTOM;
2758 if (!qWindow->isTopLevel())
2760 if (windowPos->flags & SWP_NOSIZE)
2762 const QRect suggestedFrameGeometry(windowPos->x, windowPos->y,
2763 windowPos->cx, windowPos->cy);
2764 const QRect suggestedGeometry = suggestedFrameGeometry - margins;
2766 if (!correctedGeometryF.
isValid())
2768 const QRect correctedFrameGeometry = correctedGeometryF.
toRect() + margins;
2769 if (correctedFrameGeometry == suggestedFrameGeometry)
2771 windowPos->x = correctedFrameGeometry.
left();
2772 windowPos->y = correctedFrameGeometry.
top();
2773 windowPos->cx = correctedFrameGeometry.
width();
2774 windowPos->cy = correctedFrameGeometry.
height();
2797 if (GetMenu(m_data.
hwnd))
2800 calculateFullFrameMargins();
2803void QWindowsWindow::calculateFullFrameMargins()
2844 return CreateRectRgn(
r.left(),
r.top(),
r.x() +
r.width(),
r.y() +
r.height());
2850 HRGN
result = CreateRectRgn(0, 0, 0, 0);
2851 if (CombineRgn(
result, *winRegion, rectRegion, RGN_OR)) {
2852 DeleteObject(*winRegion);
2855 DeleteObject(rectRegion);
2862 const auto end = region.
end();
2874 SetWindowRgn(m_data.
hwnd,
nullptr,
true);
2882 OffsetRgn(winRegion, margins.
left(), margins.
top());
2886 if (!SetWindowRgn(m_data.
hwnd, winRegion,
true))
2887 DeleteObject(winRegion);
2899 || activationBehavior != QWindowsApplication::AlwaysActivateWindow) {
2900 SetForegroundWindow(m_data.
hwnd);
2912 "Windows with Qt::WindowStaysOnBottomHint can't be brought to the foreground.";
2917 "Windows with Qt::WindowStaysOnTopHint will always be on the foreground.";
2921 qCWarning(lcQpaWindow) <<
"ToolTip windows should not be activated.";
2926 if (!IsWindowVisible(m_data.
hwnd))
2927 ShowWindow(m_data.
hwnd, SW_SHOW);
2929 if (IsIconic(m_data.
hwnd)) {
2930 ShowWindow(m_data.
hwnd, SW_RESTORE);
2937 const HWND oldForegroundWindow = GetForegroundWindow();
2938 if (!oldForegroundWindow)
2943 if (SendMessageTimeoutW(oldForegroundWindow, WM_NULL, 0, 0,
2944 SMTO_BLOCK | SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 1000,
nullptr) == 0) {
2945 qCWarning(lcQpaWindow) <<
"The foreground window hangs, can't activate current window.";
2949 const DWORD windowThreadProcessId = GetWindowThreadProcessId(oldForegroundWindow,
nullptr);
2950 const DWORD currentThreadId = GetCurrentThreadId();
2952 AttachThreadInput(windowThreadProcessId, currentThreadId, TRUE);
2953 const auto cleanup =
qScopeGuard([windowThreadProcessId, currentThreadId](){
2954 AttachThreadInput(windowThreadProcessId, currentThreadId, FALSE);
2957 BringWindowToTop(m_data.
hwnd);
2961 SetActiveWindow(m_data.
hwnd);
2967 qWarning(
"%s: No handle", __FUNCTION__);
2970 qCDebug(lcQpaWindow) << __FUNCTION__ <<
this <<
window() << grab;
2977 context->setKeyGrabber(
nullptr);
2986 qWarning(
"%s: No handle", __FUNCTION__);
2990 qWarning(
"%s: Not setting mouse grab for invisible window %s/'%s'",
2999 SetCapture(m_data.
hwnd);
3043 PostMessage(m_data.
hwnd, WM_SYSCOMMAND, 0xF012 , 0);
3066 if (!
w->isTopLevel()
3072 const QSize minimumSize =
w->minimumSize();
3075 const QSize maximumSize =
w->maximumSize();
3076 const bool fixedWidth = minimumSize.
width() == maximumSize.
width();
3077 const bool fixedHeight = minimumSize.
height() == maximumSize.
height();
3078 if (!fixedWidth && !fixedHeight)
3083 if (localPos.
y() >=
size.height()) {
3087 if (localPos.
y() < 0) {
3089 if (localPos.
y() < topResizeBarPos) {
3095 if (fixedWidth && (localPos.
x() < 0 || localPos.
x() >=
size.width())) {
3119 if (underMouse ==
w)
3121 for (
const QWindow *
p = underMouse;
p ;
p =
p->parent()) {
3125 if (platformWindow && !platformWindow->
cursor()->
isNull())
3146 if (m_cursor->
isNull()) {
3154 SetCursor(m_cursor->
handle());
3162 bool changed =
c->handle() != m_cursor->
handle();
3172 <<
c->handle() <<
" doApply=" << apply;
3195 UINT timeOutMs = GetCaretBlinkTime();
3196 if (!timeOutMs || timeOutMs == INFINITE)
3202 info.dwFlags = FLASHW_TRAY;
3203 info.dwTimeout = timeOutMs;
3204 info.uCount = durationMs == 0 ? 10 : UINT(durationMs) / timeOutMs;
3205 FlashWindowEx(&
info);
3213 info.dwFlags = FLASHW_STOP;
3216 FlashWindowEx(&
info);
3221 return (
style() & WS_DISABLED) == 0;
3226 const unsigned oldStyle =
style();
3227 unsigned newStyle = oldStyle;
3229 newStyle &= ~WS_DISABLED;
3231 newStyle |= WS_DISABLED;
3233 if (newStyle != oldStyle)
3253 m_iconSmall =
createHIcon(
icon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
3254 m_iconBig =
createHIcon(
icon, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
3257 SendMessage(m_data.
hwnd, WM_SETICON, 0 , LPARAM(m_iconSmall));
3258 SendMessage(m_data.
hwnd, WM_SETICON, 1 , LPARAM(m_iconBig));
3260 SendMessage(m_data.
hwnd, WM_SETICON, 0 , LPARAM(m_iconSmall));
3261 SendMessage(m_data.
hwnd, WM_SETICON, 1 , LPARAM(m_iconSmall));
3283 qCWarning(lcQpaWindow,
"%s: Unable to retrieve dark window border setting.", __FUNCTION__);
3289 const BOOL darkBorder =
d ? TRUE : FALSE;
3294 qCWarning(lcQpaWindow,
"%s: Unable to set %s window border.", __FUNCTION__,
d ?
"dark" :
"light");
3310 return m_menuBar.
data();
3338 qCWarning(lcQpaWindow) <<
"You should not set custom margins for a frameless window.";
3348 newFrame.
moveTo(topLeft);
3349 qCDebug(lcQpaWindow) << __FUNCTION__ << oldCustomMargins <<
"->" << newCustomMargins
3350 << currentFrameGeometry <<
"->" << newFrame;
3351 SetWindowPos(m_data.
hwnd,
nullptr, newFrame.
x(), newFrame.
y(), newFrame.
width(), newFrame.
height(), SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE);
3357#if QT_CONFIG(vulkan)
3366 qWarning(
"Attempted to create Vulkan surface without an instance; was QWindow::setVulkanInstance() called?");
3370 return &m_vkSurface;
3372#elif defined(QT_NO_OPENGL)
3380 m_surface = staticOpenGLContext->createWindowSurface(m_data.
hwnd, nativeConfig, err);
3391#if QT_CONFIG(vulkan)
3396 m_vkSurface = VK_NULL_HANDLE;
3402 staticOpenGLContext->destroyWindowSurface(m_surface);
3403 m_surface =
nullptr;
3417 if (currentTouchTypes.has_value() && currentTouchTypes.value() == touchTypes)
3421 ULONG touchFlags = 0;
3422 if (touchTypes.testFlag(TouchWindowTouchType::FineTouch))
3423 touchFlags |= TWF_FINETOUCH;
3424 if (touchTypes.testFlag(TouchWindowTouchType::WantPalmTouch))
3425 touchFlags |= TWF_WANTPALM;
3426 if (RegisterTouchWindow(m_data.
hwnd, touchFlags))
3460 m_borderInFullScreenDefault =
border;
3478 LONG_PTR
style = GetWindowLongPtr(
handle(), GWL_STYLE);
3482 style &= ~WS_BORDER;
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
int lightness() const noexcept
@ ApplicationPaletteChange
static Qt::ApplicationState applicationState()
static QWindowList topLevelWindows()
Returns a list of the top-level windows in the application.
static QWindowList allWindows()
Returns a list of all the windows in the application.
QScreen * primaryScreen
the primary (or default) screen of the application.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
Qt::LayoutDirection layoutDirection
the default layout direction for this application
static qreal roundScaleFactor(qreal rawFactor)
static qreal factor(C *context)
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
QSize actualSize(const QSize &size, Mode mode=Normal, State state=Off) const
Returns the actual size of the icon for the requested size, mode, and state.
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Returns a pixmap with the requested size, mode, and state, generating one if necessary.
static bool isDebugBuild() noexcept Q_DECL_CONST_FUNCTION
qsizetype size() const noexcept
const T & constFirst() const noexcept
constexpr int bottom() const noexcept
Returns the bottom margin.
constexpr bool isNull() const noexcept
Returns true if all margins are is 0; otherwise returns false.
constexpr int left() const noexcept
Returns the left margin.
constexpr int right() const noexcept
Returns the right margin.
constexpr int top() const noexcept
Returns the top margin.
QObject * parent() const
Returns a pointer to the parent object.
QVariant property(const char *name) const
Returns the value of the object's name property.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
static OpenGLModuleType openGLModuleType()
Returns the underlying OpenGL implementation type.
static QWindowsOpengl32DLL opengl32
The QPalette class contains color groups for each widget state.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr QRect marginsRemoved(const QMargins &margins) const noexcept
Removes the margins from the rectangle, shrinking it.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr void setSize(const QSize &s) noexcept
Sets the size of the rectangle to the given size.
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void moveTo(int x, int t) noexcept
Moves the rectangle, leaving the top-left corner at the given position (x, y).
constexpr QPoint center() const noexcept
Returns the center point of the rectangle.
The QRegion class specifies a clip region for a painter.
const_iterator end() const noexcept
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
const_iterator begin() const noexcept
The QScreen class is used to query screen properties. \inmodule QtGui.
QList< QScreen * > virtualSiblings() const
Get the screen's virtual siblings.
QRect availableGeometry
the screen's available geometry in pixels
QRect geometry
the screen's geometry in pixels
QPlatformScreen * handle() const
Get the platform screen handle.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr int & rheight() noexcept
Returns a reference to the height.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
constexpr int & rwidth() noexcept
Returns a reference to the width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QChar * data()
Returns a pointer to the data stored in the QString.
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
The QVulkanInstance class represents a native Vulkan instance, enabling Vulkan rendering onto a QSurf...
static QWindowPrivate * get(QWindow *window)
PositionPolicy positionPolicy
static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Make Qt Gui process all events on the event queue immediately.
static void handleGeometryChange(QWindow *window, const QRect &newRect)
static bool handleExposeEvent(QWindow *window, const QRegion ®ion)
static void handleWindowStateChanged(QWindow *window, Qt::WindowStates newState, int oldState=-1)
Qt::WindowFlags flags
the window flags of the window
SurfaceType surfaceType() const override
Returns the surface type of the window.
TouchWindowTouchTypes touchWindowTouchType() const override
WindowActivationBehavior windowActivationBehavior() const override
Base class for QWindowsForeignWindow, QWindowsWindow.
virtual bool isTopLevel() const
QMargins frameMargins_sys() const
bool isTopLevel_sys() const
void setHasBorderInFullScreen(bool border) override
QMargins customMargins() const override
bool hasBorderInFullScreen() const override
static QWindowsBaseWindow * baseWindowOf(const QWindow *w)
virtual QMargins fullFrameMargins() const
std::optional< TouchWindowTouchTypes > touchWindowTouchTypes_sys() const
static HWND handleOf(const QWindow *w)
QPoint mapToGlobal(const QPoint &pos) const override
Translates the window coordinate pos to global screen coordinates using native methods.
static bool isRtlLayout(HWND hwnd)
QRect frameGeometry_sys() const
QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes TouchWindowTouchTypes
QRect geometry_sys() const
virtual HWND handle() const =0
QPoint mapFromGlobal(const QPoint &pos) const override
Translates the global screen coordinate pos to window coordinates using native methods.
void setCustomMargins(const QMargins &margins) override
void setGeometry_sys(const QRect &rect) const
void setWindowTitle_sys(const QString &title)
ULONG STDMETHODCALLTYPE Release() override
Singleton container for all relevant information.
QWindowsScreenManager & screenManager()
void addWindow(HWND, QWindowsWindow *w)
static bool shouldHaveNonClientDpiScaling(const QWindow *window)
QString registerWindowClass(const QWindow *w)
static void forceNcCalcSize(HWND hwnd)
QSharedPointer< QWindowCreationContext > setWindowCreationContext(const QSharedPointer< QWindowCreationContext > &ctx)
QWindow * windowUnderMouse() const
static QWindowsContext * instance()
Platform cursor implementation.
static bool hasOverrideCursor()
static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen=nullptr)
static void enforceOverrideCursor()
HWND handle() const override
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
QWindowsForeignWindow(QWindow *window, HWND hwnd)
static QWindowsStaticOpenGLContext * staticOpenGLContext()
static QWindowsIntegration * instance()
Implementation of IDropTarget.
Manages a list of QWindowsScreen.
const QWindowsScreen * screenForHwnd(HWND hwnd) const
const QWindowsScreen * screenAtDp(const QPoint &p) const
const WindowsScreenList & screens() const
static bool isSingleScreen()
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
QString name() const override
bool handleNonClientHitTest(const QPoint &globalPos, LRESULT *result) const
void alertWindow(int durationMs=0)
void setWindowFlags(Qt::WindowFlags flags) override
Requests setting the window flags of this surface to flags.
void setCustomMargins(const QMargins &m) override
Sets custom margins to be added to the default margins determined by the windows style in the handlin...
void setMenuBar(QWindowsMenuBar *mb)
static QWindowsWindow * windowsWindowOf(const QWindow *w)
void invalidateSurface() override
Invalidates the window's surface by releasing its surface buffers.
HDC getDC()
Allocates a HDC for the window or returns the temporary one obtained from WinAPI BeginPaint within a ...
void setPreMoveRect(const QRect &rect)
QMargins fullFrameMargins() const override
void initialize() override
Called as part of QWindow::create(), after constructing the window.
void handleDpiChangedAfterParent(HWND hwnd)
static void setHasBorderInFullScreenStatic(QWindow *window, bool border)
void checkForScreenChanged(ScreenChangeMode mode=FromGeometryChange)
bool testFlag(unsigned f) const
static QString formatWindowTitle(const QString &title)
void setFlag(unsigned f) const
void clearFlag(unsigned f) const
void aboutToMakeCurrent()
void setFrameStrutEventsEnabled(bool enabled) override
Reimplement this method to set whether frame strut events should be sent to enabled.
static void settingsChanged()
static bool handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp)
void getSizeHints(MINMAXINFO *mmi) const
static void setHasBorderInFullScreenDefault(bool border)
QPlatformScreen * screenForGeometry(const QRect &newGeometry) const
Helper function for finding the new screen for newGeometry in response to a geometry changed event.
~QWindowsWindow() override
bool handleWmPaint(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result)
void setParent(const QPlatformWindow *window) override
This function is called to enable native child window in QPA.
bool setMouseGrabEnabled(bool grab) override
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
void applyCursor()
Applies to cursor property set on the window to the global cursor.
bool isExposed() const override
Returns if this window is exposed in the windowing system.
bool handleGeometryChanging(MSG *message) const
bool isActive() const override
Returns true if the window should appear active from a style perspective.
void setStyle(unsigned s) const
static QScreen * forcedScreenForGLWindow(const QWindow *w)
static void displayChanged()
bool setKeyboardGrabEnabled(bool grab) override
static bool setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity)
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
QRect preMoveRect() const
void setEnabled(bool enabled)
void setVisible(bool visible) override
Reimplemented in subclasses to show the surface if visible is true, and hide it if visible is false.
QSurfaceFormat format() const override
Returns the actual surface format of the window.
static const char * embeddedNativeParentHandleProperty
QWindowsMenuBar * menuBar() const
void handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
void registerTouchWindow()
QMargins frameMargins() const override
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
void handleResized(int wParam, LPARAM lParam)
void setOpacity(qreal level) override
Reimplement to be able to let Qt set the opacity level of a window.
bool isEmbedded() const override
Returns true if the window is a child of a non-Qt window.
QMargins customMargins() const override
bool isAncestorOf(const QPlatformWindow *child) const override
Returns true if the window is an ancestor of the given child.
QRect normalGeometry() const override
Returns the geometry of a window in 'normal' state (neither maximized, fullscreen nor minimized) for ...
void setExStyle(unsigned s) const
qreal dpiRelativeScale(const UINT dpi) const
void setSavedDpi(int dpi)
void requestActivateWindow() override
Reimplement to let Qt be able to request activation/focus for a window.
static QWindow * topLevelOf(QWindow *w)
void handleDpiScaledSize(WPARAM wParam, LPARAM lParam, LRESULT *result)
static bool setDarkBorderToWindow(HWND hwnd, bool d)
void updateFullFrameMargins()
QRect geometry() const override
Returns the current geometry of a window.
@ SynchronousGeometryChangeEvent
@ WithinSetParent
Automatic mouse capture on button press.
@ DisableNonClientScaling
@ FrameStrutEventsEnabled
QPoint mapToGlobal(const QPoint &pos) const override
Translates the window coordinate pos to global screen coordinates using native methods.
static const char * hasBorderInFullScreenProperty
bool startSystemMove() override
Reimplement this method to start a system move operation if the system supports it and return true to...
bool isTopLevel() const override
void releaseDC()
Releases the HDC for the window or does nothing in case it was obtained from WinAPI BeginPaint within...
static QWindow * topTransientOf(QWindow *w)
void updateRestoreGeometry()
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void moveTransientChildren()
void setCursor(const CursorHandlePtr &c)
bool hasBorderInFullScreen() const override
bool hasMouseCapture() const
void setHasBorderInFullScreen(bool border) override
QPoint mapFromGlobal(const QPoint &pos) const override
Translates the global screen coordinate pos to window coordinates using native methods.
CursorHandlePtr cursor() const
void handleCompositionSettingsChanged()
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
void setDarkBorder(bool d)
QWindowsWindow(QWindow *window, const QWindowsWindowData &data)
bool startSystemResize(Qt::Edges edges) override
Reimplement this method to start a system resize operation if the system supports it and return true ...
void setFullFrameMargins(const QMargins &newMargins)
void setMask(const QRegion ®ion) override
Reimplement to be able to let Qt set the mask of a window.
void setAlertState(bool enabled) override
Reimplement this method to set whether the window demands attention (for example, by flashing the tas...
HWND handle() const override
bool isAlertState() const override
Reimplement this method return whether the window is in an alert state.
QSet< QString >::iterator it
void newState(QList< State > &states, const char *token, const char *lexem, bool pre)
void qErrnoWarning(const char *msg,...)
T toNativePixels(const T &value, const C *context)
T fromNativePixels(const T &value, const C *context)
QRegion toNativeLocalRegion(const QRegion &pointRegion, const QWindow *window)
Combined button and popup list for selecting options.
void destroySurface(int surfaceId)
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
QTextStream & showbase(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ShowBase) on stream and r...
QTextStream & noforcesign(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::ForceSign) on stream and...
QTextStream & uppercasedigits(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::UppercaseDigits) on strea...
QTextStream & noshowbase(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() & ~QTextStream::ShowBase) on stream and ...
QTextStream & dec(QTextStream &stream)
Calls QTextStream::setIntegerBase(10) on stream and returns stream.
QTextStream & forcesign(QTextStream &stream)
Calls QTextStream::setNumberFlags(QTextStream::numberFlags() | QTextStream::ForceSign) on stream and ...
@ WindowContextHelpButtonHint
@ WindowStaysOnBottomHint
@ MSWindowsFixedSizeDialogHint
@ WindowMaximizeButtonHint
@ WindowMinimizeButtonHint
@ WindowMinMaxButtonsHint
@ WindowTransparentForInput
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
int qRound(qfloat16 d) noexcept
QPair< qreal, qreal > QDpi
#define qCWarning(category,...)
#define qCDebug(category,...)
#define SIZE(large, small, mini)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLuint64 GLenum void * handle
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLenum GLsizei GLsizei GLsizei GLint border
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLfloat GLfloat GLfloat GLfloat h
GLfloat GLfloat GLfloat alpha
GLenum GLenum GLenum GLenum GLenum scale
static bool hasAlpha(const QImage &image)
QScopeGuard< typename std::decay< F >::type > qScopeGuard(F &&f)
[qScopeGuard]
#define qPrintable(string)
#define QStringLiteral(str)
#define QT_CONFIG(feature)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
QTextStreamManipulator qSetPadChar(QChar ch)
QTextStreamManipulator qSetFieldWidth(int width)
#define Q_UNIMPLEMENTED()
Q_GUI_EXPORT QWindowPrivate * qt_window_private(QWindow *window)
QSharedPointer< CursorHandle > CursorHandlePtr
bool testFlag(MaskType mask, FlagType flag)
static const auto windowClassName
static QSize toNativeSizeConstrained(QSize dip, const QScreen *s)
static void fixTopLevelWindowFlags(Qt::WindowFlags &flags)
static QString msgUnableToSetGeometry(const QWindowsWindow *platformWindow, const QRect &requestedRect, const QRect &obtainedRect, const QMargins &fullMargins, const QMargins &customMargins)
static QRect normalFrameGeometry(HWND hwnd)
static void formatBriefRectangle(QDebug &d, const QRect &r)
static bool testShowWithoutActivating(const QWindow *window)
static bool shouldShowMaximizeButton(const QWindow *w, Qt::WindowFlags flags)
Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &)
static void setMinimizedGeometry(HWND hwnd, const QRect &r)
static bool applyNewCursor(const QWindow *w)
static bool isSoftwareGl()
static HICON createHIcon(const QIcon &icon, int xSize, int ySize)
static void updateGLWindowSettings(const QWindow *w, HWND hwnd, Qt::WindowFlags flags, qreal opacity)
static void addRectToWinRegion(const QRect &rect, HRGN *winRegion)
static QByteArray debugWinSwpPos(UINT flags)
static HRGN createRectRegion(const QRect &r)
static QByteArray debugWinStyle(DWORD style)
static QScreen * screenForDeviceName(const QWindow *w, const QString &name)
static QPoint windowPlacementOffset(HWND hwnd, const QPoint &point)
static bool applyBlurBehindWindow(HWND hwnd)
QDebug operator<<(QDebug d, const RECT &r)
static void setRestoreMaximizedFlag(HWND hwnd, bool set=true)
static RECT RECTfromQRect(const QRect &rect)
static QRect frameGeometry(HWND hwnd, bool topLevel)
static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bool accelerated, qreal level)
static QMargins invisibleMargins(QPoint screenPoint)
Calculates the dimensions of the invisible borders within the window frames which only exist on Windo...
static int getResizeBorderThickness(const UINT dpi)
static bool windowIsAccelerated(const QWindow *w)
static bool equalDpi(const QDpi &d1, const QDpi &d2)
static void formatBriefMargins(QDebug &d, const QMargins &m)
static QByteArray debugWindowPlacementFlags(const UINT flags)
static QSize qSizeOfRect(const RECT &rect)
static DWORD edgesToWinOrientation(Qt::Edges edges)
static bool shouldApplyDarkFrame(const QWindow *w)
static QByteArray debugWinExStyle(DWORD exStyle)
static CursorHandlePtr defaultCursor(const QWindow *w)
static QByteArray debugShowWindowCmd(const UINT cmd)
static HRGN qRegionToWinRegion(const QRegion ®ion)
@ DwmwaUseImmersiveDarkMode
@ DwmwaUseImmersiveDarkModeBefore20h1
static QPoint calcPosition(const QWindow *w, const QWindowCreationContextPtr &context, const QMargins &invMargins)
static QRect qrectFromRECT(const RECT &rect)
static bool queryDarkBorder(HWND hwnd)
QSharedPointer< QWindowCreationContext > QWindowCreationContextPtr
static QWindow::Visibility windowVisibility_sys(HWND hwnd)
static void screenToClient(HWND hwnd, POINT *wP)
const char className[16]
[1]
QFuture< QSet< QChar > > set
[10]
if(qFloatDistance(a, b)<(1<< 7))
[0]
QFileInfo info(fileName)
[8]
obj metaObject() -> className()
static GpuDescription detect()
QString gpuSuitableScreen
Active Context for creating windows.
QWindowCreationContext(const QWindow *w, const QScreen *s, const QRect &geometryIn, const QRect &geometry, const QMargins &customMargins, DWORD style, DWORD exStyle)
void applyToMinMaxInfo(MINMAXINFO *mmi) const
QRect requestedGeometryIn
Stores geometry constraints and provides utility functions.
static QMargins frameOnPrimaryScreen(const QWindow *w, DWORD style, DWORD exStyle)
static bool positionIncludesFrame(const QWindow *w)
static void frameSizeConstraints(const QWindow *w, const QScreen *screen, const QMargins &margins, QSize *minimumSize, QSize *maximumSize)
static QMargins frame(const QWindow *w, DWORD style, DWORD exStyle, qreal dpi)
static QPoint mapToGlobal(HWND hwnd, const QPoint &)
static QPoint mapFromGlobal(const HWND hwnd, const QPoint &)
static void applyToMinMaxInfo(const QWindow *w, const QScreen *screen, const QMargins &margins, MINMAXINFO *mmi)
static bool handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result)
bool moduleIsNotOpengl32() const
QMargins fullFrameMargins
static QWindowsWindowData create(const QWindow *w, const QWindowsWindowData ¶meters, const QString &title)
void applyWindowFlags(HWND hwnd) const
void initialize(const QWindow *w, HWND h, bool frameChange, qreal opacityLevel) const
QWindowsWindowData WindowData
WindowData create(const QWindow *w, const WindowData &data, QString title) const
void fromWindow(const QWindow *w, const Qt::WindowFlags flags, unsigned creationFlags=0)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
virtual HRESULT STDMETHODCALLTYPE SetFocus()=0