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#include <QtCore/private/qfactorycacheregistration_p.h>
49#include <QtCore/private/qsystemerror_p.h>
51#include <QtGui/private/qwindowsguieventdispatcher_p.h>
58#include <shellscalingapi.h>
79#if !defined(LANG_SYRIAC)
80# define LANG_SYRIAC 0x5a
87 if (
const int nLayouts = GetKeyboardLayoutList(0,
nullptr)) {
89 GetKeyboardLayoutList(nLayouts, lpList.
data());
90 for (
int i = 0;
i < nLayouts; ++
i) {
91 switch (PRIMARYLANGID((
quintptr)lpList[
i])) {
105#if QT_CONFIG(sessionmanager)
115 return platformSessionManager()->isInteractionBlocked();
146#if QT_CONFIG(tabletevent)
162 : m_oleInitializeResult(OleInitialize(
nullptr))
174 qWarning() <<
"QWindowsContext: OleInitialize() failed: "
183# pragma warning( disable : 4996 )
194#if QT_CONFIG(tabletevent)
195 d->m_tabletSupport.reset();
204 unregisterWindowClasses();
206#ifdef QT_USE_FACTORY_CACHE_REGISTRATION
207 detail::QWinRTFactoryCacheRegistration::clearAllCaches();
215 m_instance =
nullptr;
229 if (touchDevice.isNull()) {
230 const bool mouseEmulation =
234 if (touchDevice.isNull())
253 w->registerTouchWindow();
259#if QT_CONFIG(tabletevent)
269#if QT_CONFIG(tabletevent)
270 d->m_tabletSupport.reset();
288 if (
message != WM_POWERBROADCAST || wParam != PBT_POWERSETTINGCHANGE)
289 return DefWindowProc(hwnd,
message, wParam, lParam);
291 static bool initialized =
false;
294 return DefWindowProc(hwnd,
message, wParam, lParam);
297 auto setting =
reinterpret_cast<const POWERBROADCAST_SETTING *
>(lParam);
299 auto data =
reinterpret_cast<const DWORD *
>(&setting->Data);
306 if (HWND hwnd = tw->handle()) {
307 InvalidateRect(hwnd,
nullptr,
false);
314 return DefWindowProc(hwnd,
message, wParam, lParam);
337#if QT_CONFIG(tabletevent)
353 if (!IsValidDpiAwarenessContext(
context))
372 const auto context = GetWindowDpiAwarenessContext(hwnd);
385 const auto context = GetThreadDpiAwarenessContext();
389[[nodiscard]]
static inline DPI_AWARENESS_CONTEXT
392 switch (dpiAwareness) {
409#ifndef QT_NO_DEBUG_STREAM
414 switch (dpiAwareness) {
428 message += u
"PerMonitorVersion2"_s;
431 message += u
"Unaware_GdiScaled"_s;
441 qCDebug(lcQpaWindow) << __FUNCTION__ << dpiAwareness;
445 if (!IsValidDpiAwarenessContext(
context)) {
446 qCWarning(lcQpaWindow) << dpiAwareness <<
"is not supported by current system.";
449 if (!SetProcessDpiAwarenessContext(
context)) {
450 qCWarning(lcQpaWindow).noquote().nospace()
451 <<
"SetProcessDpiAwarenessContext() failed: "
452 << QSystemError::windowsString()
453 <<
"\nQt's default DPI awareness context is "
454 <<
"DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2. If you know what you "
455 <<
"are doing, you can overwrite this default using qt.conf "
456 <<
"(https://doc.qt.io/qt-6/highdpi.html#configuring-windows).";
531 str <<
"Qt" << QT_VERSION_MAJOR << QT_VERSION_MINOR << QT_VERSION_PATCH;
535# define xstr(s) str(s)
537 str << xstr(QT_NAMESPACE);
548 const Qt::WindowFlags
flags =
w->flags();
551 uint style = CS_DBLCLKS;
558 && (
type ==
Qt::Popup ||
w->property(
"_q_windowsDropShadow").toBool())) {
565 style |= CS_SAVEBITS;
575 cname +=
"QWindow"_L1;
581 cname +=
"ToolTip"_L1;
590 cname +=
"DropShadow"_L1;
591 if (style & CS_SAVEBITS)
592 cname +=
"SaveBits"_L1;
593 if (style & CS_OWNDC)
614 const auto appInstance =
static_cast<HINSTANCE
>(GetModuleHandle(
nullptr));
616 const bool classExists = GetClassInfo(appInstance,
reinterpret_cast<LPCWSTR
>(cname.
utf16()), &wcinfo) != FALSE
617 && wcinfo.lpfnWndProc != proc;
626 wc.cbSize =
sizeof(WNDCLASSEX);
628 wc.lpfnWndProc = proc;
631 wc.hInstance = appInstance;
632 wc.hCursor =
nullptr;
633 wc.hbrBackground =
brush;
635 wc.hIcon =
static_cast<HICON
>(LoadImage(appInstance, L
"IDI_ICON1", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE));
637 int sw = GetSystemMetrics(SM_CXSMICON);
638 int sh = GetSystemMetrics(SM_CYSMICON);
639 wc.hIconSm =
static_cast<HICON
>(LoadImage(appInstance, L
"IDI_ICON1", IMAGE_ICON, sw, sh, 0));
641 wc.hIcon =
static_cast<HICON
>(LoadImage(
nullptr, IDI_APPLICATION, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE | LR_SHARED));
642 wc.hIconSm =
nullptr;
646 wc.hIconSm =
nullptr;
649 wc.lpszMenuName =
nullptr;
650 wc.lpszClassName =
reinterpret_cast<LPCWSTR
>(cname.
utf16());
651 ATOM atom = RegisterClassEx(&wc);
653 qErrnoWarning(
"QApplication::regClass: Registering window class '%s' failed.",
657 qCDebug(lcQpaWindow).nospace() << __FUNCTION__ <<
' ' << cname
659 <<
" brush=" <<
brush <<
" icon=" <<
icon <<
" atom=" << atom;
663void QWindowsContext::unregisterWindowClasses()
665 const auto appInstance =
static_cast<HINSTANCE
>(GetModuleHandle(
nullptr));
667 for (
const QString &
name :
std::as_const(d->m_registeredWindowClassNames)) {
697 if ((*it)->menuBar() == mb)
715 for (HWND
w = hwnd;
w;
w = GetParent(
w)) {
762 POINT point = screenPoint;
765 const HWND
child = ChildWindowFromPointEx(*hwnd, point, cwexFlags);
779 if (!(cwexFlags & CWP_SKIPTRANSPARENT)
780 && (GetWindowLongPtr(
child, GWL_EXSTYLE) & WS_EX_TRANSPARENT)) {
781 const HWND nonTransparentChild = ChildWindowFromPointEx(*hwnd, point, cwexFlags | CWP_SKIPTRANSPARENT);
782 if (!nonTransparentChild || nonTransparentChild == *hwnd)
785 *
result = nonTransparentWindow;
786 *hwnd = nonTransparentChild;
795 const QPoint &screenPointIn,
796 unsigned cwex_flags)
const
799 const POINT screenPoint = { screenPointIn.
x(), screenPointIn.
y() };
804 if (
const HWND
window = WindowFromPoint(screenPoint))
813 const DWORD sessionId = WTSGetActiveConsoleSessionId();
814 if (sessionId != 0xFFFFFFFF) {
817#if !defined(Q_CC_MINGW)
818 if (WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, sessionId,
821 const WTSINFOEXW *
info =
reinterpret_cast<WTSINFOEXW *
>(
buffer);
822 result =
info->Level == 1 &&
info->Data.WTSInfoExLevel1.SessionFlags == WTS_SESSIONSTATE_LOCK;
827 if (WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, sessionId,
830 const DWORD *
p =
reinterpret_cast<DWORD *
>(
buffer);
832 const DWORD sessionFlags = *(
p + 4);
853#if QT_CONFIG(tabletevent)
854 return d->m_tabletSupport.data();
866 const wchar_t *windowName,
867 WNDPROC wndProc, DWORD style)
870 wndProc = DefWindowProc;
872 return CreateWindowEx(0,
reinterpret_cast<LPCWSTR
>(
className.utf16()),
874 CW_USEDEFAULT, CW_USEDEFAULT,
875 CW_USEDEFAULT, CW_USEDEFAULT,
876 HWND_MESSAGE,
nullptr,
static_cast<HINSTANCE
>(GetModuleHandle(
nullptr)),
nullptr);
882 SetWindowPos(hwnd,
nullptr, 0, 0, 0, 0,
883 SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
889 const BOOL
result = dpi != 0
890 ? SystemParametersInfoForDpi(action,
param,
out, 0, dpi)
891 : SystemParametersInfo(action,
param,
out, 0);
909 memset(ncm, 0,
sizeof(NONCLIENTMETRICS));
910 ncm->cbSize =
sizeof(NONCLIENTMETRICS);
937 return window->isTopLevel()
949 case WM_IME_STARTCOMPOSITION:
950 case WM_IME_ENDCOMPOSITION:
951 case WM_IME_COMPOSITION:
956 case WM_NCMOUSEHOVER:
957 case WM_NCMOUSELEAVE:
962 case WM_DWMNCRENDERINGCHANGED:
968 return (
m >= WM_MOUSEFIRST &&
m <= WM_MOUSELAST)
969 || (
m >= WM_NCMOUSEMOVE &&
m <= WM_NCXBUTTONDBLCLK)
970 || (
m >= WM_KEYFIRST &&
m <= WM_KEYLAST);
978 result = EnableNonClientDpiScaling(hwnd) != FALSE;
980 const DWORD errorCode = GetLastError();
981 qErrnoWarning(
int(errorCode),
"EnableNonClientDpiScaling() failed for HWND %p (%lu)",
996 WPARAM wParam, LPARAM lParam,
1005 msg.wParam = wParam;
1006 msg.lParam = lParam;
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)) {
1094 integration->updateApplicationBadge();
1095 if (integration->darkModeHandling().testFlag(QWindowsApplication::DarkModeStyle)) {
1099 if (darkModeChanged) {
1100 if (integration->darkModeHandling().testFlag(QWindowsApplication::DarkModeWindowFrames)) {
1143 if (platformWindow) {
1148 qCDebug(lcQpaEvents) <<
"Event window: " << platformWindow->window();
1150 qWarning(
"%s: No Qt Window found for event 0x%x (%s), hwnd=0x%p.",
1161 if (wParam == DBT_DEVNODES_CHANGED)
1166 wic->handleInputLanguageChanged(wParam, lParam);
1179 if (platformWindow ==
nullptr || platformWindow->menuBar() ==
nullptr)
1181 return platformWindow->menuBar()->notifyAboutToShow(
reinterpret_cast<HMENU
>(wParam));
1187 if (platformWindow ==
nullptr || platformWindow->menuBar() ==
nullptr)
1189 return platformWindow->menuBar()->notifyTriggered(LOWORD(wParam));
1191 platformWindow->handleMoved();
1194 platformWindow->handleResized(
static_cast<int>(wParam), lParam);
1197 platformWindow->getSizeHints(
reinterpret_cast<MINMAXINFO *
>(lParam));
1202 return platformWindow->handleNonClientHitTest(
QPoint(msg.pt.x, msg.pt.y),
result);
1204 return platformWindow->handleGeometryChanging(&msg);
1206 return platformWindow->handleWmPaint(hwnd,
message, wParam, lParam,
result);
1208 if (!platformWindow->frameStrutEventsEnabled())
1215 if (!platformWindow->frameStrutEventsEnabled())
1222 if (!IsZoomed(hwnd))
1223 platformWindow->updateRestoreGeometry();
1227 platformWindow->checkForScreenChanged();
1228 handleExitSizeMove(platformWindow->window());
1229 if (!IsZoomed(hwnd))
1230 platformWindow->updateRestoreGeometry();
1261 handleFocusEvent(et, platformWindow);
1264 if (!platformWindow->window()->isVisible()) {
1270 platformWindow->handleHidden();
1278 theme->windowsThemeChanged(platformWindow->window());
1282 platformWindow->handleCompositionSettingsChanged();
1286 *
result = LRESULT(MA_NOACTIVATE);
1289#if QT_CONFIG(tabletevent)
1290 if (!d->m_tabletSupport.isNull())
1291 d->m_tabletSupport->notifyActivate();
1297 platformWindow->alertWindow();
1303 *
result = LRESULT(MA_NOACTIVATE);
1307#ifndef QT_NO_CONTEXTMENU
1309 return handleContextMenuEvent(platformWindow->window(), msg);
1312#ifndef QT_NO_WHATSTHIS
1313 QWindowSystemInterface::handleEnterWhatsThisEvent();
1318 platformWindow->handleDpiScaledSize(wParam, lParam,
result);
1321 platformWindow->handleDpiChanged(hwnd, wParam, lParam);
1324 platformWindow->handleDpiChangedAfterParent(hwnd);
1326#if QT_CONFIG(sessionmanager)
1341 if (lParam & ENDSESSION_LOGOFF)
1352 const bool endsession = wParam != 0;
1357 if (endsession && !qGuiAppPriv->aboutToQuitEmitted) {
1359 int index = QGuiApplication::staticMetaObject.indexOfSignal(
"aboutToQuit()");
1386 QWindow *nextActiveWindow =
nullptr;
1389 QWindow *modalWindow =
nullptr;
1391 modalWindow->requestActivate();
1398 if (currentFocusWindow && currentFocusWindow != platformWindow->
window()) {
1399 currentFocusWindow->requestActivate();
1403 nextActiveWindow = platformWindow->
window();
1407 if (
const HWND nextActiveHwnd =
GetFocus())
1409 if (nextActivePlatformWindow != platformWindow)
1410 nextActiveWindow = nextActivePlatformWindow->window();
1418#ifndef QT_NO_CONTEXTMENU
1419bool QWindowsContext::handleContextMenuEvent(
QWindow *
window,
const MSG &msg)
1421 bool mouseTriggered =
false;
1424 if (msg.lParam !=
int(0xffffffff)) {
1425 mouseTriggered =
true;
1426 globalPos.
setX(msg.pt.x);
1427 globalPos.
setY(msg.pt.y);
1431 if (GetClientRect(msg.hwnd, &clientRect)) {
1432 if (
pos.x() < clientRect.left ||
pos.x() >= clientRect.right ||
1433 pos.y() < clientRect.top ||
pos.y() >= clientRect.bottom)
1463 if (currentButtons == appButtons)
1472 if (appButtons.testFlag(
button) && !currentButtons.testFlag(
button)) {
1474 currentButtons,
button,
type, keyboardModifiers);
1497 LR
"(Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced)")
1499 return value.second ?
value.first : defaultValue;
1502static inline bool isEmptyRect(
const RECT &
rect)
1507static inline QMargins marginsFromRects(
const RECT &
frame,
const RECT &client)
1510 frame.right - client.right,
frame.bottom - client.bottom);
1513static RECT rectFromNcCalcSize(UINT
message, WPARAM wParam, LPARAM lParam,
int n)
1515 RECT
result = {0, 0, 0, 0};
1516 if (
message == WM_NCCALCSIZE && wParam)
1517 result =
reinterpret_cast<const NCCALCSIZE_PARAMS *
>(lParam)->rgrc[
n];
1521static inline bool isMinimized(HWND hwnd)
1523 WINDOWPLACEMENT windowPlacement;
1524 windowPlacement.length =
sizeof(WINDOWPLACEMENT);
1525 return GetWindowPlacement(hwnd, &windowPlacement) && windowPlacement.showCmd == SW_SHOWMINIMIZED;
1528static inline bool isTopLevel(HWND hwnd)
1530 return (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_CHILD) == 0;
1546 const RECT ncCalcSizeFrame = rectFromNcCalcSize(
message, wParam, lParam, 0);
1550 qCDebug(lcQpaEvents).nospace() <<
"EVENT: hwd=" << hwnd <<
' ' << eventName
1552 << int(wParam) <<
" at " << GET_X_LPARAM(lParam) <<
','
1553 << GET_Y_LPARAM(lParam) <<
" handled=" << handled;
1563 if (
message == WM_NCCALCSIZE && !isEmptyRect(ncCalcSizeFrame) && isTopLevel(hwnd) && !isMinimized(hwnd)) {
1565 marginsFromRects(ncCalcSizeFrame, rectFromNcCalcSize(
message, wParam, lParam, 0));
1566 if (margins.
left() >= 0) {
1567 if (platformWindow) {
1568 qCDebug(lcQpaWindow) << __FUNCTION__ <<
"WM_NCCALCSIZE for" << hwnd << margins;
1588 if (dispatcher && dispatcher->
filterNativeEvent(nativeEventType(), msg, &filterResult)) {
1589 *
result = LRESULT(filterResult);
1600 *
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().
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
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.
The QKeyEvent class describes a key event.
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 int x() const noexcept
Returns the x coordinate of this point.
constexpr void setY(int y) noexcept
Sets the y coordinate of this point to the given y coordinate.
constexpr int y() const noexcept
Returns the y coordinate of this point.
constexpr void setX(int x) noexcept
Sets the x coordinate of this point to the given x coordinate.
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...
T * data() const noexcept
Returns the value of the pointer referenced by this object.
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
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
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...
QString toString(StringFormat mode=WithBraces) const
QPair< 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 handleThemeChange(QWindow *window=nullptr)
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)
static void handleWindowActivated(QWindow *window, Qt::FocusReason r=Qt::OtherFocusReason)
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)
QList< int > possibleKeys(const QKeyEvent *e) const
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
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.
bool composition(HWND hwnd, LPARAM lParam)
Notify focus object about markup or final text.
bool startComposition(HWND hwnd)
static void setWindowsImeEnabled(QWindowsWindow *platformWindow, bool enabled)
bool handleIME_Request(WPARAM wparam, LPARAM lparam, LRESULT *result)
bool endComposition(HWND hwnd)
@ DontPassOsMouseEventsSynthesizedFromTouch
void updateApplicationBadge()
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)
static Qt::KeyboardModifiers queryKeyboardModifiers()
void setDetectAltGrModifier(bool a)
QList< int > possibleKeys(const QKeyEvent *e) const
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...
void setActive(bool active)
bool allowsInteraction() override
Tablet support for Windows.
static void setAbsoluteRange(int a)
static QWindowsTabletSupport * create()
static bool queryDarkMode()
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.
WindowsEventType
Enumerations for WM_XX events.
@ PointerActivateWindowEvent
@ InputMethodEndCompositionEvent
@ QueryEndSessionApplicationEvent
@ ShowEventOnParentRestoring
@ InputMethodCompositionEvent
@ KeyboardLayoutChangeEvent
@ 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]
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
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]
QFileInfo info(fileName)
[8]
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)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent
virtual HRESULT STDMETHODCALLTYPE GetFocus(__RPC__deref_out_opt IRawElementProviderFragment **pRetVal)=0