16#if QT_CONFIG(tabletevent)
20#include <private/qguiapplication_p.h>
21#if QT_CONFIG(accessibility)
24#if QT_CONFIG(sessionmanager)
25# include <private/qsessionmanager_p.h>
31#include <QtGui/qwindow.h>
32#include <qpa/qwindowsysteminterface.h>
33#include <qpa/qwindowsysteminterface_p.h>
34#include <qpa/qplatformnativeinterface.h>
35#include <QtGui/qguiapplication.h>
36#include <QtGui/qopenglcontext.h>
37#include <QtGui/qpointingdevice.h>
39#include <QtCore/qset.h>
40#include <QtCore/qhash.h>
41#include <QtCore/qlibraryinfo.h>
42#include <QtCore/qstringlist.h>
43#include <QtCore/qdebug.h>
44#include <QtCore/qsysinfo.h>
45#include <QtCore/qscopedpointer.h>
46#include <QtCore/quuid.h>
47#include <QtCore/private/qwinregistry_p.h>
48#if QT_CONFIG(cpp_winrt)
49# include <QtCore/private/qfactorycacheregistration_p.h>
51#include <QtCore/private/qsystemerror_p.h>
53#include <QtGui/private/qwindowsguieventdispatcher_p.h>
54#include <QtGui/private/qwindowsthemecache_p.h>
61#include <shellscalingapi.h>
82#if !defined(LANG_SYRIAC)
83# define LANG_SYRIAC 0x5a
90 if (
const int nLayouts = GetKeyboardLayoutList(0,
nullptr)) {
91 QScopedArrayPointer<HKL> lpList(
new HKL[nLayouts]);
92 GetKeyboardLayoutList(nLayouts, lpList.data());
93 for (
int i = 0;
i < nLayouts; ++
i) {
94 switch (PRIMARYLANGID((
quintptr)lpList[
i])) {
108#if QT_CONFIG(sessionmanager)
118 return platformSessionManager()->isInteractionBlocked();
149#if QT_CONFIG(tabletevent)
150 QScopedPointer<QWindowsTabletSupport> m_tabletSupport;
163 : m_oleInitializeResult(OleInitialize(
nullptr))
174 qWarning() <<
"QWindowsContext: OleInitialize() failed: "
183# pragma warning( disable : 4996 )
194#if QT_CONFIG(tabletevent)
195 d->m_tabletSupport.reset();
206 unregisterWindowClasses();
208#ifdef QT_USE_FACTORY_CACHE_REGISTRATION
209 detail::QWinRTFactoryCacheRegistration::clearAllCaches();
217 m_instance =
nullptr;
231 if (touchDevice.isNull()) {
232 const bool mouseEmulation =
236 if (touchDevice.isNull())
255 w->registerTouchWindow();
261#if QT_CONFIG(tabletevent)
271#if QT_CONFIG(tabletevent)
272 d->m_tabletSupport.reset();
290 if (
message != WM_POWERBROADCAST || wParam != PBT_POWERSETTINGCHANGE)
291 return DefWindowProc(hwnd,
message, wParam, lParam);
293 static bool initialized =
false;
296 return DefWindowProc(hwnd,
message, wParam, lParam);
299 auto setting =
reinterpret_cast<const POWERBROADCAST_SETTING *
>(lParam);
301 auto data =
reinterpret_cast<const DWORD *
>(&setting->Data);
308 if (HWND hwnd = tw->handle()) {
309 InvalidateRect(hwnd,
nullptr,
false);
316 return DefWindowProc(hwnd,
message, wParam, lParam);
339#if QT_CONFIG(tabletevent)
355 if (!IsValidDpiAwarenessContext(
context))
374 const auto context = GetWindowDpiAwarenessContext(hwnd);
387 const auto context = GetThreadDpiAwarenessContext();
391[[nodiscard]]
static inline DPI_AWARENESS_CONTEXT
394 switch (dpiAwareness) {
411#ifndef QT_NO_DEBUG_STREAM
416 switch (dpiAwareness) {
430 message += u
"PerMonitorVersion2"_s;
433 message += u
"Unaware_GdiScaled"_s;
443 qCDebug(lcQpaWindow) << __FUNCTION__ << dpiAwareness;
447 if (!IsValidDpiAwarenessContext(
context)) {
448 qCWarning(lcQpaWindow) << dpiAwareness <<
"is not supported by current system.";
451 if (!SetProcessDpiAwarenessContext(
context)) {
452 qCWarning(lcQpaWindow).noquote().nospace()
453 <<
"SetProcessDpiAwarenessContext() failed: "
454 << QSystemError::windowsString()
455 <<
"\nQt's default DPI awareness context is "
456 <<
"DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2. If you know what you "
457 <<
"are doing, you can overwrite this default using qt.conf "
458 <<
"(https://doc.qt.io/qt-6/highdpi.html#configuring-windows).";
528 str <<
"Qt" << QT_VERSION_MAJOR << QT_VERSION_MINOR << QT_VERSION_PATCH;
532# define xstr(s) str(s)
534 str << xstr(QT_NAMESPACE);
547 const Qt::WindowFlags
flags =
w->flags();
550 uint style = CS_DBLCLKS;
557 && (
type ==
Qt::Popup ||
w->property(
"_q_windowsDropShadow").toBool())) {
564 style |= CS_SAVEBITS;
574 cname +=
"QWindow"_L1;
580 cname +=
"ToolTip"_L1;
589 cname +=
"DropShadow"_L1;
590 if (style & CS_SAVEBITS)
591 cname +=
"SaveBits"_L1;
592 if (style & CS_OWNDC)
613 const auto appInstance =
static_cast<HINSTANCE
>(GetModuleHandle(
nullptr));
615 const bool classExists = GetClassInfo(appInstance,
reinterpret_cast<LPCWSTR
>(cname.utf16()), &wcinfo) != FALSE
616 && wcinfo.lpfnWndProc != proc;
625 wc.cbSize =
sizeof(WNDCLASSEX);
627 wc.lpfnWndProc = proc;
630 wc.hInstance = appInstance;
631 wc.hCursor =
nullptr;
632 wc.hbrBackground =
brush;
634 wc.hIcon =
static_cast<HICON
>(LoadImage(appInstance, L
"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE));
636 int sw = GetSystemMetrics(SM_CXSMICON);
637 int sh = GetSystemMetrics(SM_CYSMICON);
638 wc.hIconSm =
static_cast<HICON
>(LoadImage(appInstance, L
"IDI_ICON1", IMAGE_ICON, sw, sh, 0));
640 wc.hIcon =
static_cast<HICON
>(LoadImage(
nullptr, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED));
641 wc.hIconSm =
nullptr;
645 wc.hIconSm =
nullptr;
648 wc.lpszMenuName =
nullptr;
649 wc.lpszClassName =
reinterpret_cast<LPCWSTR
>(cname.utf16());
650 ATOM atom = RegisterClassEx(&wc);
652 qErrnoWarning(
"QApplication::regClass: Registering window class '%s' failed.",
656 qCDebug(lcQpaWindow).nospace() << __FUNCTION__ <<
' ' << cname
658 <<
" brush=" <<
brush <<
" icon=" <<
icon <<
" atom=" << atom;
662void QWindowsContext::unregisterWindowClasses()
664 const auto appInstance =
static_cast<HINSTANCE
>(GetModuleHandle(
nullptr));
666 for (
const QString &
name :
std::as_const(d->m_registeredWindowClassNames)) {
696 if ((*it)->menuBar() == mb)
714 for (HWND
w = hwnd;
w;
w = GetParent(
w)) {
761 POINT point = screenPoint;
764 const HWND
child = ChildWindowFromPointEx(*hwnd, point, cwexFlags);
778 if (!(cwexFlags & CWP_SKIPTRANSPARENT)
779 && (GetWindowLongPtr(
child, GWL_EXSTYLE) & WS_EX_TRANSPARENT)) {
780 const HWND nonTransparentChild = ChildWindowFromPointEx(*hwnd, point, cwexFlags | CWP_SKIPTRANSPARENT);
781 if (!nonTransparentChild || nonTransparentChild == *hwnd)
784 *
result = nonTransparentWindow;
785 *hwnd = nonTransparentChild;
794 const QPoint &screenPointIn,
795 unsigned cwex_flags)
const
798 const POINT screenPoint = { screenPointIn.x(), screenPointIn.y() };
803 if (
const HWND
window = WindowFromPoint(screenPoint))
812 const DWORD sessionId = WTSGetActiveConsoleSessionId();
813 if (sessionId != 0xFFFFFFFF) {
816#if !defined(Q_CC_MINGW)
817 if (WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, sessionId,
820 const WTSINFOEXW *
info =
reinterpret_cast<WTSINFOEXW *
>(
buffer);
821 result =
info->Level == 1 &&
info->Data.WTSInfoExLevel1.SessionFlags == WTS_SESSIONSTATE_LOCK;
826 if (WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, sessionId,
829 const DWORD *
p =
reinterpret_cast<DWORD *
>(
buffer);
831 const DWORD sessionFlags = *(
p + 4);
852#if QT_CONFIG(tabletevent)
853 return d->m_tabletSupport.data();
865 const wchar_t *windowName,
866 WNDPROC wndProc, DWORD style)
869 wndProc = DefWindowProc;
871 return CreateWindowEx(0,
reinterpret_cast<LPCWSTR
>(
className.utf16()),
873 CW_USEDEFAULT, CW_USEDEFAULT,
874 CW_USEDEFAULT, CW_USEDEFAULT,
875 HWND_MESSAGE,
nullptr,
static_cast<HINSTANCE
>(GetModuleHandle(
nullptr)),
nullptr);
881 SetWindowPos(hwnd,
nullptr, 0, 0, 0, 0,
882 SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
888 const BOOL
result = dpi != 0
889 ? SystemParametersInfoForDpi(action,
param,
out, 0, dpi)
890 : SystemParametersInfo(action,
param,
out, 0);
908 memset(ncm, 0,
sizeof(NONCLIENTMETRICS));
909 ncm->cbSize =
sizeof(NONCLIENTMETRICS);
936 return window->isTopLevel()
948 case WM_IME_STARTCOMPOSITION:
949 case WM_IME_ENDCOMPOSITION:
950 case WM_IME_COMPOSITION:
955 case WM_NCMOUSEHOVER:
956 case WM_NCMOUSELEAVE:
961 case WM_DWMNCRENDERINGCHANGED:
967 return (
m >= WM_MOUSEFIRST &&
m <= WM_MOUSELAST)
968 || (
m >= WM_NCMOUSEMOVE &&
m <= WM_NCXBUTTONDBLCLK)
969 || (
m >= WM_KEYFIRST &&
m <= WM_KEYLAST);
977 result = EnableNonClientDpiScaling(hwnd) != FALSE;
979 const DWORD errorCode = GetLastError();
980 qErrnoWarning(
int(errorCode),
"EnableNonClientDpiScaling() failed for HWND %p (%lu)",
995 WPARAM wParam, LPARAM lParam,
1004 msg.wParam = wParam;
1005 msg.lParam = lParam;
1006 msg.time = GetMessageTime();
1007 msg.pt.x = msg.pt.y = 0;
1009 msg.pt.x = GET_X_LPARAM(lParam);
1010 msg.pt.y = GET_Y_LPARAM(lParam);
1017 GetCursorPos(&msg.pt);
1021 *platformWindowPtr = platformWindow;
1064 qWarning() <<
"External WM_DESTROY received for " << platformWindow->window()
1065 <<
", parent: " << platformWindow->window()->parent()
1066 <<
", transient parent: " << platformWindow->window()->transientParent();
1080#if QT_CONFIG(accessibility)
1081 return QWindowsUiaAccessibility::handleWmGetObject(hwnd, wParam, lParam,
result);
1088 if ((wParam == 0) && (lParam != 0)
1089 && (wcscmp(
reinterpret_cast<LPCWSTR
>(lParam), L
"ImmersiveColorSet") == 0)) {
1129 if (platformWindow) {
1134 qCDebug(lcQpaEvents) <<
"Event window: " << platformWindow->window();
1136 qWarning(
"%s: No Qt Window found for event 0x%x (%s), hwnd=0x%p.",
1147 if (wParam == DBT_DEVNODES_CHANGED)
1152 wic->handleInputLanguageChanged(wParam, lParam);
1165 if (platformWindow ==
nullptr || platformWindow->menuBar() ==
nullptr)
1167 return platformWindow->menuBar()->notifyAboutToShow(
reinterpret_cast<HMENU
>(wParam));
1173 if (platformWindow ==
nullptr || platformWindow->menuBar() ==
nullptr)
1175 return platformWindow->menuBar()->notifyTriggered(LOWORD(wParam));
1177 platformWindow->handleMoved();
1180 platformWindow->handleResized(
static_cast<int>(wParam), lParam);
1183 platformWindow->getSizeHints(
reinterpret_cast<MINMAXINFO *
>(lParam));
1188 return platformWindow->handleNonClientHitTest(
QPoint(msg.pt.x, msg.pt.y),
result);
1190 return platformWindow->handleGeometryChanging(&msg);
1192 return platformWindow->handleWmPaint(hwnd,
message, wParam, lParam,
result);
1194 if (!platformWindow->frameStrutEventsEnabled())
1201 if (!platformWindow->frameStrutEventsEnabled())
1208 if (!IsZoomed(hwnd))
1209 platformWindow->updateRestoreGeometry();
1213 platformWindow->checkForScreenChanged();
1214 handleExitSizeMove(platformWindow->window());
1215 if (!IsZoomed(hwnd))
1216 platformWindow->updateRestoreGeometry();
1247 handleFocusEvent(et, platformWindow);
1250 if (!platformWindow->window()->isVisible()) {
1256 platformWindow->handleHidden();
1265 theme->windowsThemeChanged(platformWindow->window());
1269 platformWindow->handleCompositionSettingsChanged();
1273 *
result = LRESULT(MA_NOACTIVATE);
1276#if QT_CONFIG(tabletevent)
1277 if (!d->m_tabletSupport.isNull())
1278 d->m_tabletSupport->notifyActivate();
1284 platformWindow->alertWindow();
1290 *
result = LRESULT(MA_NOACTIVATE);
1294#ifndef QT_NO_CONTEXTMENU
1296 return handleContextMenuEvent(platformWindow->window(), msg);
1299#ifndef QT_NO_WHATSTHIS
1300 QWindowSystemInterface::handleEnterWhatsThisEvent();
1305 platformWindow->handleDpiScaledSize(wParam, lParam,
result);
1308 platformWindow->handleDpiChanged(hwnd, wParam, lParam);
1311 platformWindow->handleDpiChangedAfterParent(hwnd);
1313#if QT_CONFIG(sessionmanager)
1316 if (sessionManager->isActive()) {
1317 *
result = sessionManager->wasCanceled() ? 0 : 1;
1321 sessionManager->setActive(
true);
1322 sessionManager->blocksInteraction();
1323 sessionManager->clearCancellation();
1328 if (lParam & ENDSESSION_LOGOFF)
1331 *
result = sessionManager->wasCanceled() ? 0 : 1;
1337 sessionManager->setActive(
false);
1338 sessionManager->allowsInteraction();
1339 const bool endsession = wParam != 0;
1344 if (endsession && !qGuiAppPriv->aboutToQuitEmitted) {
1346 int index = QGuiApplication::staticMetaObject.indexOfSignal(
"aboutToQuit()");
1373 QWindow *nextActiveWindow =
nullptr;
1376 QWindow *modalWindow =
nullptr;
1378 modalWindow->requestActivate();
1385 if (currentFocusWindow && currentFocusWindow != platformWindow->
window()) {
1386 currentFocusWindow->requestActivate();
1390 nextActiveWindow = platformWindow->
window();
1394 if (
const HWND nextActiveHwnd = GetFocus())
1396 if (nextActivePlatformWindow != platformWindow)
1397 nextActiveWindow = nextActivePlatformWindow->window();
1405#ifndef QT_NO_CONTEXTMENU
1406bool QWindowsContext::handleContextMenuEvent(
QWindow *
window,
const MSG &msg)
1408 bool mouseTriggered =
false;
1411 if (msg.lParam !=
int(0xffffffff)) {
1412 mouseTriggered =
true;
1413 globalPos.
setX(msg.pt.x);
1414 globalPos.
setY(msg.pt.y);
1418 if (GetClientRect(msg.hwnd, &clientRect)) {
1419 if (
pos.x() < clientRect.left ||
pos.x() >= clientRect.right ||
1420 pos.y() < clientRect.top ||
pos.y() >= clientRect.bottom)
1450 if (currentButtons == appButtons)
1455 const QPoint localPos = platWin->mapFromGlobal(globalPos);
1459 if (appButtons.testFlag(
button) && !currentButtons.testFlag(
button)) {
1461 currentButtons,
button,
type, keyboardModifiers);
1484 LR
"(Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced)")
1486 return value.second ?
value.first : defaultValue;
1489static inline bool isEmptyRect(
const RECT &
rect)
1494static inline QMargins marginsFromRects(
const RECT &
frame,
const RECT &client)
1497 frame.right - client.right,
frame.bottom - client.bottom);
1500static RECT rectFromNcCalcSize(UINT
message, WPARAM wParam, LPARAM lParam,
int n)
1502 RECT
result = {0, 0, 0, 0};
1503 if (
message == WM_NCCALCSIZE && wParam)
1504 result =
reinterpret_cast<const NCCALCSIZE_PARAMS *
>(lParam)->rgrc[
n];
1508static inline bool isMinimized(HWND hwnd)
1510 WINDOWPLACEMENT windowPlacement;
1511 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
1512 return GetWindowPlacement(hwnd, &windowPlacement) && windowPlacement.showCmd == SW_SHOWMINIMIZED;
1515static inline bool isTopLevel(HWND hwnd)
1517 return (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_CHILD) == 0;
1533 const RECT ncCalcSizeFrame = rectFromNcCalcSize(
message, wParam, lParam, 0);
1537 qCDebug(lcQpaEvents).nospace() <<
"EVENT: hwd=" << hwnd <<
' ' << eventName
1539 << int(wParam) <<
" at " << GET_X_LPARAM(lParam) <<
','
1540 << GET_Y_LPARAM(lParam) <<
" handled=" << handled;
1550 if (
message == WM_NCCALCSIZE && !isEmptyRect(ncCalcSizeFrame) && isTopLevel(hwnd) && !isMinimized(hwnd)) {
1552 marginsFromRects(ncCalcSizeFrame, rectFromNcCalcSize(
message, wParam, lParam, 0));
1553 if (margins.
left() >= 0) {
1554 if (platformWindow) {
1555 qCDebug(lcQpaWindow) << __FUNCTION__ <<
"WM_NCCALCSIZE for" << hwnd << margins;
1560 ctx->margins = margins;
1575 if (dispatcher && dispatcher->
filterNativeEvent(nativeEventType(), msg, &filterResult)) {
1576 *
result = LRESULT(filterResult);
1587 *
result = LRESULT(filterResult);
static JNINativeMethod methods[]
static QAbstractEventDispatcher * instance(QThread *thread=nullptr)
Returns a pointer to the event dispatcher object for the specified thread.
bool filterNativeEvent(const QByteArray &eventType, void *message, qintptr *result)
Sends message through the event filters that were set by installNativeEventFilter().
static bool is_app_running
static void quit()
\threadsafe
Type
This enum type defines the valid event types in Qt.
@ NonClientAreaMouseButtonRelease
static QGuiApplicationPrivate * instance()
static QWindowList topLevelWindows()
Returns a list of the top-level windows in the application.
static QWindow * modalWindow()
Returns the most recently shown modal window.
static QWindow * focusWindow()
Returns the QWindow that receives events tied to focus, such as key events.
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
const_iterator cbegin() const noexcept
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
iterator erase(const_iterator it)
T value(const Key &key) const noexcept
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
const_iterator cend() const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
static bool isDebugBuild() noexcept Q_DECL_CONST_FUNCTION
static void setFilterRules(const QString &rules)
Configures which categories and message types should be enabled through a set of rules.
constexpr int left() const noexcept
Returns the left margin.
Native interface to QPlatformWindow. \inmodule QtGui.
static QObjectPrivate * get(QObject *o)
static OpenGLModuleType openGLModuleType()
Returns the underlying OpenGL implementation type.
\inmodule QtCore\reentrant
constexpr void setY(int y) noexcept
Sets the y coordinate of this point to the given y coordinate.
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
bool contains(const T &value) const
iterator insert(const T &value)
bool isNull() const noexcept
Returns true if this object refers to \nullptr.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QUuid createUuid()
On any platform other than Windows, this function returns a new UUID with variant QUuid::DCE and vers...
std::pair< DWORD, bool > dwordValue(QStringView subKey) const
static bool handleNativeEvent(QWindow *window, const QByteArray &eventType, void *message, qintptr *result)
Passes a native event identified by eventType to the window.
static void handleFocusWindowChanged(QWindow *window, Qt::FocusReason r=Qt::OtherFocusReason)
static void handleContextMenuEvent(QWindow *window, bool mouseTriggered, const QPoint &pos, const QPoint &globalPos, Qt::KeyboardModifiers modifiers)
static bool handleMouseEvent(QWindow *window, const QPointF &local, const QPointF &global, Qt::MouseButtons state, Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods=Qt::NoModifier, Qt::MouseEventSource source=Qt::MouseEventNotSynthesized)
static void registerInputDevice(const QInputDevice *device)
static bool handleCloseEvent(QWindow *window)
Singleton container for all relevant information.
QSharedPointer< QWindowCreationContext > windowCreationContext() const
QWindowsScreenManager & screenManager()
static QString classNamePrefix()
QWindowsWindow * findClosestPlatformWindow(HWND) const
QWindow * findWindow(HWND) const
void addWindow(HWND, QWindowsWindow *w)
static bool systemParametersInfoForScreen(unsigned action, unsigned param, void *out, const QPlatformScreen *screen=nullptr)
static DWORD readAdvancedExplorerSettings(const wchar_t *subKey, DWORD defaultValue)
static bool setProcessDpiAwareness(QtWindows::DpiAwareness dpiAwareness)
void clearWindowUnderMouse()
HDC displayContext() const
static bool shouldHaveNonClientDpiScaling(const QWindow *window)
QWindowsTabletSupport * tabletSupport() const
static bool systemParametersInfoForWindow(unsigned action, unsigned param, void *out, const QPlatformWindow *win=nullptr)
QString registerWindowClass(const QWindow *w)
static void setTabletAbsoluteRange(int a)
static void forceNcCalcSize(HWND hwnd)
void registerTouchWindows()
QWindowsWindow * findPlatformWindowAt(HWND parent, const QPoint &screenPoint, unsigned cwex_flags) const
void setKeyGrabber(QWindow *hwnd)
static bool nonClientMetrics(NONCLIENTMETRICS *ncm, unsigned dpi=0)
HWND createDummyWindow(const QString &classNameIn, const wchar_t *windowName, WNDPROC wndProc=nullptr, DWORD style=WS_OVERLAPPED)
Convenience to create a non-visible, message-only dummy window for example used as clipboard watcher ...
void setAsyncExpose(bool value)
QSharedPointer< QWindowCreationContext > setWindowCreationContext(const QSharedPointer< QWindowCreationContext > &ctx)
static QtWindows::DpiAwareness windowDpiAwareness(HWND hwnd)
bool windowsProc(HWND hwnd, UINT message, QtWindows::WindowsEventType et, WPARAM wParam, LPARAM lParam, LRESULT *result, QWindowsWindow **platformWindowPtr)
Main windows procedure registered for windows.
unsigned systemInfo() const
static QtWindows::DpiAwareness processDpiAwareness()
QWindowsWindow * findPlatformWindow(HWND) const
QWindow * keyGrabber() const
QWindow * windowUnderMouse() const
QPlatformKeyMapper * keyMapper() const
bool useRTLExtensions() const
bool initPointer(unsigned integrationOptions)
static bool systemParametersInfo(unsigned action, unsigned param, void *out, unsigned dpi=0)
QWindowsMimeRegistry & mimeConverter() const
static bool nonClientMetricsForWindow(NONCLIENTMETRICS *ncm, const QPlatformWindow *win=nullptr)
static bool isSessionLocked()
bool initPowerNotificationHandler()
HandleBaseWindowHash & windows()
static QWindowsContext * instance()
static bool nonClientMetricsForScreen(NONCLIENTMETRICS *ncm, const QPlatformScreen *screen=nullptr)
static bool filterNativeEvent(MSG *msg, LRESULT *result)
void setDetectAltGrModifier(bool a)
static bool hasOverrideCursor()
static QPoint mousePosition()
static void enforceOverrideCursor()
static const char * windowsMessageName(UINT msg)
Windows Input context implementation.
static void setWindowsImeEnabled(QWindowsWindow *platformWindow, bool enabled)
@ DontPassOsMouseEventsSynthesizedFromTouch
static QWindowsIntegration * instance()
Translates Windows keys to QWindowSystemInterface events.
bool translateKeyEvent(QWindow *widget, HWND hwnd, const MSG &msg, LRESULT *result)
To be called from the window procedure.
void setUseRTLExtensions(bool e)
QWindow * keyGrabber() const
bool useRTLExtensions() const
void setKeyGrabber(QWindow *w)
void setDetectAltGrModifier(bool a)
Manages the list of QWindowsMimeConverter instances.
static Qt::MouseButtons queryMouseButtons()
bool translateScrollEvent(QWindow *window, HWND hwnd, MSG msg, LRESULT *result)
bool translateTouchEvent(QWindow *widget, HWND hwnd, QtWindows::WindowsEventType t, MSG msg, LRESULT *result)
void setTouchDevice(const QPointingDevicePtr &d)
QWindow * windowUnderMouse() const
bool translateGestureEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType, MSG msg, LRESULT *)
const QPointingDevicePtr & touchDevice() const
void clearWindowUnderMouse()
bool translateMouseEvent(QWindow *widget, HWND hwnd, QtWindows::WindowsEventType t, MSG msg, LRESULT *result)
QWindow * windowUnderMouse() const
static QPointingDevicePtr createTouchDevice(bool mouseEmulation)
const QPointingDevicePtr & touchDevice() const
bool translatePointerEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result)
bool translateMouseEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result)
void clearWindowUnderMouse()
void setTouchDevice(const QPointingDevicePtr &d)
Manages a list of QWindowsScreen.
bool handleScreenChanges()
Synchronizes the screen list, adds new screens, removes deleted ones and propagates resolution change...
Tablet support for Windows.
static void setAbsoluteRange(int a)
static QWindowsTabletSupport * create()
static void handleSettingsChanged()
static QWindowsTheme * instance()
static QWindowsWindow * windowsWindowOf(const QWindow *w)
bool testFlag(unsigned f) const
static void settingsChanged()
static bool handleGeometryChangingMessage(MSG *message, const QWindow *qWindow, const QMargins &marginsDp)
static const char * embeddedNativeParentHandleProperty
static QWindow * topLevelOf(QWindow *w)
@ WithinSetParent
Automatic mouse capture on button press.
void setFullFrameMargins(const QMargins &newMargins)
QSet< QString >::iterator it
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
Q_GUI_EXPORT void clearThemeCache(HWND hwnd)
WindowsEventType
Enumerations for WM_XX events.
@ PointerActivateWindowEvent
@ InputMethodEndCompositionEvent
@ QueryEndSessionApplicationEvent
@ InputLanguageChangeEvent
@ ShowEventOnParentRestoring
@ InputMethodCompositionEvent
@ InputMethodOpenCandidateWindowEvent
@ MouseActivateWindowEvent
@ DpiChangedAfterParentEvent
@ InputMethodStartCompositionEvent
@ EndSessionApplicationEvent
@ InputMethodKeyDownEvent
@ CompositionSettingsChanged
@ InputMethodCloseCandidateWindowEvent
@ AccessibleObjectFromWindowRequest
QTextStream & hex(QTextStream &stream)
Calls QTextStream::setIntegerBase(16) on stream and returns stream.
QTextStream & dec(QTextStream &stream)
Calls QTextStream::setIntegerBase(10) on stream and returns stream.
@ WindowDoesNotAcceptFocus
@ WindowTransparentForInput
@ ActiveWindowFocusReason
#define QByteArrayLiteral(str)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
int qRound(qfloat16 d) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLsizei const GLchar * message
GLenum const GLint * param
GLenum GLenum GLenum input
#define qPrintable(string)
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
#define DPI_AWARENESS_CONTEXT_UNAWARE
QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamIn, LPARAM lParamIn)
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE
#define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2
#define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE
#define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED
LRESULT QT_WIN_CALLBACK qWindowsPowerWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
static bool enableNonClientDpiScaling(HWND hwnd)
static bool isInputMessage(UINT m)
static DPI_AWARENESS_CONTEXT qtDpiAwarenessToDpiAwarenessContext(QtWindows::DpiAwareness dpiAwareness)
static bool useRTL_Extensions()
static bool sessionManagerInteractionBlocked()
static QWindowsInputContext * windowsInputContext()
static QtWindows::DpiAwareness dpiAwarenessContextToQtDpiAwareness(DPI_AWARENESS_CONTEXT context)
QDebug operator<<(QDebug d, QtWindows::DpiAwareness dpiAwareness)
static bool findPlatformWindowHelper(const POINT &screenPoint, unsigned cwexFlags, const QWindowsContext *context, HWND *hwnd, QWindowsWindow **result)
Find a child window at a screen point.
LRESULT QT_WIN_CALLBACK qWindowsWndProc(HWND, UINT, WPARAM, LPARAM)
static void clientToScreen(HWND hwnd, POINT *wP)
static void screenToClient(HWND hwnd, POINT *wP)
const char className[16]
[1]
QTextStream out(stdout)
[7]
application x qt windows mime
[2]
void applyToMinMaxInfo(MINMAXINFO *mmi) const
QWindowsMouseHandler m_mouseHandler
const HRESULT m_oleInitializeResult
QWindowsKeyMapper m_keyMapper
QSet< QString > m_registeredWindowClassNames
QSharedPointer< QWindowCreationContext > m_creationContext
QWindowsPointerHandler m_pointerHandler
QWindowsScreenManager m_screenManager
QWindow * m_lastActiveWindow
QWindowsMimeRegistry m_mimeConverter
QWindowsContext::HandleBaseWindowHash m_windows
HPOWERNOTIFY m_powerNotification
static QPoint mapFromGlobal(const HWND hwnd, const QPoint &)
static bool handleCalculateSize(const QMargins &customMargins, const MSG &msg, LRESULT *result)