Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtwindowsglobal.h
Go to the documentation of this file.
1// Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch>
2// Copyright (C) 2016 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6#ifndef QTWINDOWSGLOBAL_H
7#define QTWINDOWSGLOBAL_H
8
9#include <QtCore/qt_windows.h>
10#include <QtCore/qnamespace.h>
11
12#ifndef WM_DWMCOMPOSITIONCHANGED
13# define WM_DWMCOMPOSITIONCHANGED 0x31E
14#endif
15
16#ifndef WM_DWMCOLORIZATIONCOLORCHANGED
17# define WM_DWMCOLORIZATIONCOLORCHANGED 0x0320
18#endif
19
20#ifndef WM_SYSCOLORCHANGE
21# define WM_SYSCOLORCHANGE 0x0015
22#endif
23
24#ifndef WM_TOUCH
25# define WM_TOUCH 0x0240
26#endif
27
28#ifndef WM_GESTURE
29# define WM_GESTURE 0x0119
30#endif
31
32#ifndef WM_DPICHANGED
33# define WM_DPICHANGED 0x02E0
34#endif
35
36#ifndef WM_GETDPISCALEDSIZE
37# define WM_GETDPISCALEDSIZE 0x02E4
38#endif
39
40// WM_POINTER support from Windows 8 onwards (WINVER >= 0x0602)
41#ifndef WM_POINTERUPDATE
42# define WM_NCPOINTERUPDATE 0x0241
43# define WM_NCPOINTERDOWN 0x0242
44# define WM_NCPOINTERUP 0x0243
45# define WM_POINTERUPDATE 0x0245
46# define WM_POINTERDOWN 0x0246
47# define WM_POINTERUP 0x0247
48# define WM_POINTERENTER 0x0249
49# define WM_POINTERLEAVE 0x024A
50# define WM_POINTERACTIVATE 0x024B
51# define WM_POINTERCAPTURECHANGED 0x024C
52# define WM_POINTERWHEEL 0x024E
53# define WM_POINTERHWHEEL 0x024F
54#endif // WM_POINTERUPDATE
55
56// Sent when an interaction starts over a window that has been activated for
57// the Direct Manipulation API (Windows 8 onwards).
58#ifndef DM_POINTERHITTEST
59# define DM_POINTERHITTEST 0x0250
60#endif
61
62#if !defined(_DPI_AWARENESS_CONTEXTS_)
63# define DPI_AWARENESS_CONTEXT_UNAWARE ((HANDLE)-1)
64# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((HANDLE)-2)
65# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((HANDLE)-3)
66# define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((HANDLE)-4)
67# define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((HANDLE)-5)
68#endif
69
70QT_BEGIN_NAMESPACE
71
72namespace QtWindows
73{
74
75enum WindowsEventTypeFlags
76{
77 WindowEventFlag = 0x10000,
78 MouseEventFlag = 0x20000,
79 NonClientEventFlag = 0x40000,
80 InputMethodEventFlag = 0x80000,
81 KeyEventFlag = 0x100000,
82 KeyDownEventFlag = 0x200000,
83 TouchEventFlag = 0x400000,
84 ClipboardEventFlag = 0x800000,
85 ApplicationEventFlag = 0x1000000,
86 ThemingEventFlag = 0x2000000,
87 GenericEventFlag = 0x4000000, // Misc
88 PointerEventFlag = 0x8000000,
89};
90
91enum WindowsEventType // Simplify event types
92{
93 ExposeEvent = WindowEventFlag + 1,
94 ActivateWindowEvent = WindowEventFlag + 2,
95 DeactivateWindowEvent = WindowEventFlag + 3,
96 MouseActivateWindowEvent = WindowEventFlag + 4,
97 LeaveEvent = WindowEventFlag + 5,
98 CloseEvent = WindowEventFlag + 6,
99 ShowEvent = WindowEventFlag + 7,
100 ShowEventOnParentRestoring = WindowEventFlag + 20,
101 HideEvent = WindowEventFlag + 8,
102 DestroyEvent = WindowEventFlag + 9,
103 GeometryChangingEvent = WindowEventFlag + 10,
104 MoveEvent = WindowEventFlag + 11,
105 ResizeEvent = WindowEventFlag + 12,
106 QuerySizeHints = WindowEventFlag + 15,
107 CalculateSize = WindowEventFlag + 16,
108 FocusInEvent = WindowEventFlag + 17,
109 FocusOutEvent = WindowEventFlag + 18,
110 WhatsThisEvent = WindowEventFlag + 19,
111 DpiChangedEvent = WindowEventFlag + 21,
112 EnterSizeMoveEvent = WindowEventFlag + 22,
113 ExitSizeMoveEvent = WindowEventFlag + 23,
114 PointerActivateWindowEvent = WindowEventFlag + 24,
115 DpiScaledSizeEvent = WindowEventFlag + 25,
116 DpiChangedAfterParentEvent = WindowEventFlag + 27,
117 TaskbarButtonCreated = WindowEventFlag + 28,
118 MouseEvent = MouseEventFlag + 1,
119 MouseWheelEvent = MouseEventFlag + 2,
120 CursorEvent = MouseEventFlag + 3,
121 TouchEvent = TouchEventFlag + 1,
122 PointerEvent = PointerEventFlag + 1,
123 NonClientMouseEvent = NonClientEventFlag + MouseEventFlag + 1,
124 NonClientHitTest = NonClientEventFlag + 2,
125 NonClientCreate = NonClientEventFlag + 3,
126 NonClientActivate = NonClientEventFlag + 4,
127 NonClientPointerEvent = NonClientEventFlag + PointerEventFlag + 4,
128 KeyEvent = KeyEventFlag + 1,
129 KeyDownEvent = KeyEventFlag + KeyDownEventFlag + 1,
130 InputLanguageChangeEvent = KeyEventFlag + 2,
131 InputMethodKeyEvent = InputMethodEventFlag + KeyEventFlag + 1,
132 InputMethodKeyDownEvent = InputMethodEventFlag + KeyEventFlag + KeyDownEventFlag + 1,
133 ClipboardEvent = ClipboardEventFlag + 1,
134 ActivateApplicationEvent = ApplicationEventFlag + 1,
135 DeactivateApplicationEvent = ApplicationEventFlag + 2,
136 AccessibleObjectFromWindowRequest = ApplicationEventFlag + 3,
137 QueryEndSessionApplicationEvent = ApplicationEventFlag + 4,
138 EndSessionApplicationEvent = ApplicationEventFlag + 5,
139 AppCommandEvent = ApplicationEventFlag + 6,
140 DeviceChangeEvent = ApplicationEventFlag + 7,
141 MenuAboutToShowEvent = ApplicationEventFlag + 8,
142 AcceleratorCommandEvent = ApplicationEventFlag + 9,
143 MenuCommandEvent = ApplicationEventFlag + 10,
144 InputMethodStartCompositionEvent = InputMethodEventFlag + 1,
145 InputMethodCompositionEvent = InputMethodEventFlag + 2,
146 InputMethodEndCompositionEvent = InputMethodEventFlag + 3,
147 InputMethodOpenCandidateWindowEvent = InputMethodEventFlag + 4,
148 InputMethodCloseCandidateWindowEvent = InputMethodEventFlag + 5,
149 InputMethodRequest = InputMethodEventFlag + 6,
150 ThemeChanged = ThemingEventFlag + 1,
151 CompositionSettingsChanged = ThemingEventFlag + 2,
152 SettingChangedEvent = 438,
153 ScrollEvent = GenericEventFlag + 1,
154 ContextMenu = 123,
155 GestureEvent = 124,
156 DirectManipulationHitTestEvent = 125,
157 UnknownEvent = 542
158};
159Q_DECLARE_MIXED_ENUM_OPERATORS(bool, WindowsEventTypeFlags, WindowsEventType);
160Q_DECLARE_MIXED_ENUM_OPERATORS(bool, WindowsEventType, WindowsEventTypeFlags);
161
162enum class DpiAwareness
163{
164 Invalid = -1,
165 Unaware,
166 System,
167 PerMonitor,
168 PerMonitorVersion2,
169 Unaware_GdiScaled
170};
171
172} // namespace QtWindows
173
174inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamIn, LPARAM lParamIn)
175{
176 static const UINT WM_TASKBAR_BUTTON_CREATED = []{
177 UINT message = RegisterWindowMessage(L"TaskbarButtonCreated");
178 // In case the application is run elevated, allow the
179 // TaskbarButtonCreated message through.
180 ChangeWindowMessageFilter(message, MSGFLT_ADD);
181 return message;
182 }();
183
184 switch (message) {
185 case WM_PAINT:
186 case WM_ERASEBKGND:
187 return QtWindows::ExposeEvent;
188 case WM_CLOSE:
189 return QtWindows::CloseEvent;
190 case WM_DESTROY:
191 return QtWindows::DestroyEvent;
192 case WM_ACTIVATEAPP:
193 return (int)wParamIn ?
194 QtWindows::ActivateApplicationEvent : QtWindows::DeactivateApplicationEvent;
195 case WM_MOUSEACTIVATE:
196 return QtWindows::MouseActivateWindowEvent;
198 return QtWindows::PointerActivateWindowEvent;
199 case WM_ACTIVATE:
200 return LOWORD(wParamIn) == WA_INACTIVE ?
201 QtWindows::DeactivateWindowEvent : QtWindows::ActivateWindowEvent;
202 case WM_SETCURSOR:
203 return QtWindows::CursorEvent;
204 case WM_MOUSELEAVE:
205 return QtWindows::MouseEvent;
206 case WM_HSCROLL:
207 return QtWindows::ScrollEvent;
208 case WM_MOUSEWHEEL:
209 case WM_MOUSEHWHEEL:
210 return QtWindows::MouseWheelEvent;
211 case WM_WINDOWPOSCHANGING:
212 return QtWindows::GeometryChangingEvent;
213 case WM_MOVE:
214 return QtWindows::MoveEvent;
215 case WM_SHOWWINDOW:
216 if (wParamIn)
217 return lParamIn == SW_PARENTOPENING ? QtWindows::ShowEventOnParentRestoring : QtWindows::ShowEvent;
218 return QtWindows::HideEvent;
219 case WM_SIZE:
220 return QtWindows::ResizeEvent;
221 case WM_NCCREATE:
222 return QtWindows::NonClientCreate;
223 case WM_NCCALCSIZE:
224 return QtWindows::CalculateSize;
225 case WM_NCHITTEST:
226 return QtWindows::NonClientHitTest;
227 case WM_NCACTIVATE:
228 return QtWindows::NonClientActivate;
229 case WM_GETMINMAXINFO:
230 return QtWindows::QuerySizeHints;
231 case WM_KEYDOWN: // keyboard event
232 case WM_SYSKEYDOWN:
233 return QtWindows::KeyDownEvent;
234 case WM_KEYUP:
235 case WM_SYSKEYUP:
236 case WM_CHAR:
237 return QtWindows::KeyEvent;
238 case WM_IME_CHAR:
239 return QtWindows::InputMethodKeyEvent;
240 case WM_IME_KEYDOWN:
241 return QtWindows::InputMethodKeyDownEvent;
242#ifdef WM_INPUTLANGCHANGE
243 case WM_INPUTLANGCHANGE:
244 return QtWindows::InputLanguageChangeEvent;
245#endif // WM_INPUTLANGCHANGE
246 case WM_TOUCH:
247 return QtWindows::TouchEvent;
248 case WM_CHANGECBCHAIN:
249 case WM_DRAWCLIPBOARD:
250 case WM_RENDERFORMAT:
251 case WM_RENDERALLFORMATS:
252 case WM_DESTROYCLIPBOARD:
253 return QtWindows::ClipboardEvent;
254 case WM_IME_STARTCOMPOSITION:
255 return QtWindows::InputMethodStartCompositionEvent;
256 case WM_IME_ENDCOMPOSITION:
257 return QtWindows::InputMethodEndCompositionEvent;
258 case WM_IME_COMPOSITION:
259 return QtWindows::InputMethodCompositionEvent;
260 case WM_IME_REQUEST:
261 return QtWindows::InputMethodRequest;
262 case WM_IME_NOTIFY:
263 switch (int(wParamIn)) {
264 case IMN_OPENCANDIDATE:
265 return QtWindows::InputMethodOpenCandidateWindowEvent;
266 case IMN_CLOSECANDIDATE:
267 return QtWindows::InputMethodCloseCandidateWindowEvent;
268 default:
269 break;
270 }
271 break;
272 case WM_GETOBJECT:
273 return QtWindows::AccessibleObjectFromWindowRequest;
274 case WM_SETFOCUS:
275 return QtWindows::FocusInEvent;
276 case WM_KILLFOCUS:
277 return QtWindows::FocusOutEvent;
278 // Among other things, WM_SETTINGCHANGE happens when the taskbar is moved
279 // and therefore the "working area" changes.
280 // http://msdn.microsoft.com/en-us/library/ms695534(v=vs.85).aspx
281 case WM_SETTINGCHANGE:
282 return QtWindows::SettingChangedEvent;
283 case WM_THEMECHANGED:
284 case WM_SYSCOLORCHANGE: // Handle color change as theme change (QTBUG-34170).
286 return QtWindows::ThemeChanged;
288 return QtWindows::CompositionSettingsChanged;
289#ifndef QT_NO_CONTEXTMENU
290 case WM_CONTEXTMENU:
291 return QtWindows::ContextMenu;
292#endif
293 case WM_SYSCOMMAND:
294 if ((wParamIn & 0xfff0) == SC_CONTEXTHELP)
295 return QtWindows::WhatsThisEvent;
296 break;
297 case WM_QUERYENDSESSION:
298 return QtWindows::QueryEndSessionApplicationEvent;
299 case WM_ENDSESSION:
300 return QtWindows::EndSessionApplicationEvent;
301#if defined(WM_APPCOMMAND)
302 case WM_APPCOMMAND:
303 return QtWindows::AppCommandEvent;
304#endif
305 case WM_GESTURE:
306 return QtWindows::GestureEvent;
308 return QtWindows::DirectManipulationHitTestEvent;
309 case WM_DEVICECHANGE:
310 return QtWindows::DeviceChangeEvent;
311 case WM_INITMENU:
312 case WM_INITMENUPOPUP:
313 return QtWindows::MenuAboutToShowEvent;
314 case WM_COMMAND:
315 return HIWORD(wParamIn) ? QtWindows::AcceleratorCommandEvent : QtWindows::MenuCommandEvent;
316 case WM_DPICHANGED:
317 return QtWindows::DpiChangedEvent;
318 case WM_DPICHANGED_AFTERPARENT:
319 return QtWindows::DpiChangedAfterParentEvent;
321 return QtWindows::DpiScaledSizeEvent;
322 case WM_ENTERSIZEMOVE:
323 return QtWindows::EnterSizeMoveEvent;
324 case WM_EXITSIZEMOVE:
325 return QtWindows::ExitSizeMoveEvent;
326 default:
327 break;
328 }
329 if (message >= WM_NCMOUSEMOVE && message <= WM_NCMBUTTONDBLCLK)
330 return QtWindows::NonClientMouseEvent; //
331 if ((message >= WM_MOUSEFIRST && message <= WM_MOUSELAST)
332 || (message >= WM_XBUTTONDOWN && message <= WM_XBUTTONDBLCLK))
333 return QtWindows::MouseEvent;
334 if (message >= WM_NCPOINTERUPDATE && message <= WM_NCPOINTERUP)
335 return QtWindows::NonClientPointerEvent;
336 if (message >= WM_POINTERUPDATE && message <= WM_POINTERHWHEEL)
337 return QtWindows::PointerEvent;
338 if (message == WM_TASKBAR_BUTTON_CREATED)
339 return QtWindows::TaskbarButtonCreated;
340 return QtWindows::UnknownEvent;
341}
342
343#ifndef QT_NO_DEBUG_STREAM
344extern QDebug operator<<(QDebug, QtWindows::DpiAwareness);
345#endif
346
348
349#endif // QTWINDOWSGLOBAL_H
Base class for QWindowsForeignWindow, QWindowsWindow.
virtual bool isTopLevel() const
QMargins frameMargins_sys() const
bool isTopLevel_sys() const
unsigned exStyle() const
void setHasBorderInFullScreen(bool border) override
QMargins customMargins() const override
bool windowEvent(QEvent *event) override
Reimplement this method to be able to do any platform specific event handling.
bool hasBorderInFullScreen() const override
static QWindowsBaseWindow * baseWindowOf(const QWindow *w)
bool hasMaximumWidth() const
HWND parentHwnd() const
virtual QMargins fullFrameMargins() const
unsigned style() const
QRect geometry() const override
Returns the current geometry of a window.
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.
HWND handle() const override=0
QMargins frameMargins() const override
QWindowsBaseWindow(QWindow *window)
bool hasMaximumHeight() const
static bool isRtlLayout(HWND hwnd)
QRect frameGeometry_sys() const
WId winId() const override
Reimplement in subclasses to return a handle to the native window.
QRect geometry_sys() const
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
bool hasMaximumSize() const
void setWindowTitle_sys(const QString &title)
Platform cursor implementation.
static bool hasOverrideCursor()
static QPoint mousePosition()
void setOverrideCursor(const QCursor &cursor) override
Reimplement this function in subclass to set an override cursor on the associated screen and return t...
static HCURSOR createPixmapCursor(const PixmapCursor &pc, qreal scaleFactor=1)
static HCURSOR createPixmapCursor(QPixmap pixmap, const QPoint &hotSpot, qreal scaleFactor=1)
void changeCursor(QCursor *widgetCursor, QWindow *widget) override
Set a cursor on a window.
static PixmapCursor customCursor(Qt::CursorShape cursorShape, const QPlatformScreen *screen=nullptr)
HCURSOR hCursor(const QCursor &c) const
void clearOverrideCursor() override
Reimplement this function in subclass to clear the override cursor.
CursorHandlePtr standardWindowCursor(Qt::CursorShape s=Qt::ArrowCursor)
Return cached standard cursor resources or create new ones.
static State cursorState()
static HCURSOR createCursorFromShape(Qt::CursorShape cursorShape, const QPlatformScreen *screen=nullptr)
static void enforceOverrideCursor()
QWindowsCursor(const QPlatformScreen *screen)
QPixmap dragDefaultCursor(Qt::DropAction action) const
CursorHandlePtr pixmapWindowCursor(const QCursor &c)
Return cached pixmap cursor or create new one.
QSize size() const override
Returns the size of the cursor, in native pixels.
QPoint pos() const override
void setPos(const QPoint &pos) override
Window wrapping GetDesktopWindow not allowing any manipulation.
HWND handle() const override
QMargins frameMargins() const override
QWindowsDesktopWindow(QWindow *window)
bool isTopLevel() const override
Window wrapping a foreign native window.
void setGeometry(const QRect &rect) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
bool isForeignWindow() const override
HWND handle() const override
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
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.
void setWindowTitle(const QString &title) override
Reimplement to set the window title to title.
QWindowsForeignWindow(QWindow *window, HWND hwnd)
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
static QWindowsStaticOpenGLContext * staticOpenGLContext()
Windows native menu bar.
Provides access to native handles.
void * nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
void * nativeResourceForCursor(const QByteArray &resource, const QCursor &cursor) override
void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override
Implementation of IDropTarget.
Manages a list of QWindowsScreen.
bool handleScreenChanges()
Synchronizes the screen list, adds new screens, removes deleted ones and propagates resolution change...
const QWindowsScreen * screenForHwnd(HWND hwnd) const
const WindowsScreenList & screens() const
const QWindowsScreen * screenForRect(const RECT *rect) const
Windows screen.
qreal refreshRate() const override
Reimplement this function in subclass to return the vertical refresh rate of the screen,...
QString serialNumber() const override
Reimplement this function in subclass to return the serial number of this screen.
QDpi logicalDpi() const override
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch met...
QList< QPlatformScreen * > virtualSiblings() const override
Determine siblings in a virtual desktop system.
Qt::ScreenOrientation orientation() const override
Reimplement this function in subclass to return the current orientation of the screen,...
QPlatformCursor * cursor() const override
Reimplement this function in subclass to return the cursor of the screen.
QPixmap grabWindow(WId window, int qX, int qY, int qWidth, int qHeight) const override
This function is called when Qt needs to be able to grab the content of a window.
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
qreal devicePixelRatio() const override
Reimplement this function in subclass to return the device pixel ratio for the screen.
const CursorPtr & cursorPtr() const
QPlatformScreen::SubpixelAntialiasingType subpixelAntialiasingTypeHint() const override
Queries ClearType settings to check the pixel layout.
static bool setOrientationPreference(Qt::ScreenOrientation o)
static int baseDpi
QRect availableGeometry() const override
Reimplement in subclass to return the pixel geometry of the available space This normally is the desk...
QString name() const override
QString manufacturer() const override
Reimplement this function in subclass to return the manufacturer of this screen.
QString model() const override
Reimplement this function in subclass to return the model of this screen.
QDpi logicalBaseDpi() const override
Reimplement to return the base logical DPI for the platform.
HMONITOR handle() const override
int depth() const override
Reimplement in subclass to return current depth of the screen.
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
const QWindowsScreenData & data() const
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
static Qt::ScreenOrientation orientationPreference()
QColorSpace colorSpace() const override
virtual void * moduleHandle() const =0
Raster or OpenGL Window.
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 ...
QMargins fullFrameMargins() const override
void checkForScreenChanged(ScreenChangeMode mode=FromGeometryChange, const RECT *suggestedRect=nullptr)
void initialize() override
Called as part of QWindow::create(), after constructing the window.
void handleDpiChangedAfterParent(HWND hwnd)
static void setHasBorderInFullScreenStatic(QWindow *window, bool border)
int savedDpi() const
void requestUpdate() override
Requests an QEvent::UpdateRequest event.
bool testFlag(unsigned f) const
static QString formatWindowTitle(const QString &title)
void setFlag(unsigned f) const
void clearFlag(unsigned f) const
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)
~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.
static bool hasNoNativeFrame(HWND hwnd, Qt::WindowFlags flags)
qreal opacity() const
QRect restoreGeometry() const
static void * userDataOf(HWND hwnd)
bool setMouseGrabEnabled(bool grab) override
void propagateSizeHints() override
Reimplement to propagate the size hints of the QWindow.
static void setUserDataOf(HWND hwnd, void *ud)
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)
QString windowTitle() const override
Reimplement to return the actual window title used in the underlying windowing system unless the titl...
static void displayChanged()
bool setKeyboardGrabEnabled(bool grab) override
static bool setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity)
void raise() override
Reimplement to be able to let Qt raise windows to the top of the desktop.
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.
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
bool isLayered() const
void handleDpiChanged(HWND hwnd, WPARAM wParam, LPARAM lParam)
QMargins frameMargins() const override
void setWindowIcon(const QIcon &icon) override
Reimplement to set the window icon to icon.
bool isClientAreaExpanded() const
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 handleNonClientActivate(LRESULT *result) const
bool isEnabled() const
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
QMargins safeAreaMargins() const override
The safe area margins of a window represent the area that is safe to place content within,...
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)
QRect geometry() const override
Returns the current geometry of a window.
bool frameStrutEventsEnabled() const override
Reimplement this method to return whether frame strut events are enabled.
@ WithinSetParent
Automatic mouse capture on button press.
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...
void lower() override
Reimplement to be able to let Qt lower windows to the bottom of the desktop.
void setWindowState(Qt::WindowStates state) override
Requests setting the window state of this surface to type.
void setCursor(const CursorHandlePtr &c)
bool hasBorderInFullScreen() const override
bool hasMouseCapture() const
void * surface(void *nativeConfig, int *err)
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
bool isVisible() 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 &region) 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.
Combined button and popup list for selecting options.
static int resourceType(const QByteArray &key)
#define WM_GESTURE
#define WM_TOUCH
#define WM_POINTERUPDATE
#define WM_GETDPISCALEDSIZE
#define WM_NCPOINTERUP
#define WM_POINTERHWHEEL
#define WM_DPICHANGED
#define WM_SYSCOLORCHANGE
#define WM_DWMCOMPOSITIONCHANGED
#define WM_NCPOINTERUPDATE
#define WM_POINTERACTIVATE
#define WM_DWMCOLORIZATIONCOLORCHANGED
#define DM_POINTERHITTEST
bool operator==(const QWindowsPixmapCursorCacheKey &k1, const QWindowsPixmapCursorCacheKey &k2)
size_t qHash(const QWindowsPixmapCursorCacheKey &k, size_t seed) noexcept
static void clientToScreen(HWND hwnd, POINT *wP)
static void screenToClient(HWND hwnd, POINT *wP)
Active Context for creating windows.
const QScreen * screen
const QWindow * window
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
PixmapCursor(const QPixmap &pix=QPixmap(), const QPoint &h=QPoint())
Stores geometry constraints and provides utility functions.
static QMargins frameOnPrimaryScreen(const QWindow *w, DWORD style, DWORD exStyle)
static QMargins frame(const QWindow *w, HWND hwnd)
static QMargins frame(const QWindow *w, const QRect &geometry, DWORD style, DWORD exStyle)
static QMargins frameOnPrimaryScreen(const QWindow *w, HWND hwnd)
static bool positionIncludesFrame(const QWindow *w)
static bool handleCalculateSize(const QWindow *window, const QMargins &customMargins, const MSG &msg, LRESULT *result)
static QPoint mapToGlobal(const QWindow *w, const QPoint &)
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 QPoint mapFromGlobal(const QWindow *w, const QPoint &)
static void applyToMinMaxInfo(const QWindow *w, const QMargins &margins, MINMAXINFO *mmi)
static void applyToMinMaxInfo(const QWindow *w, const QScreen *screen, const QMargins &margins, MINMAXINFO *mmi)
QWindowsPixmapCursorCacheKey(const QCursor &c, qreal scaleFactor)
Qt::WindowFlags flags
static QWindowsWindowData create(const QWindow *w, const QWindowsWindowData &parameters, const QString &title)