diff options
Diffstat (limited to 'src/plugins/platforms/windows')
8 files changed, 29 insertions, 24 deletions
diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json index e37351f9e0..072acdd115 100644 --- a/src/plugins/platforms/windows/openglblacklists/default.json +++ b/src/plugins/platforms/windows/openglblacklists/default.json @@ -93,7 +93,7 @@ }, { "id": 8, - "description": "Standard VGA: Insufficent support for OpenGL, D3D9 and D3D11", + "description": "Standard VGA: Insufficient support for OpenGL, D3D9 and D3D11", "vendor_id": "0x0000", "device_id": ["0x0000"], "os": { diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 58d29884e7..d5c3022080 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -924,7 +924,7 @@ static inline QString errorMessageFromComError(const _com_error &comError) TCHAR *message = nullptr; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr, DWORD(comError.Error()), MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), - message, 0, nullptr); + reinterpret_cast<LPWSTR>(&message), 0, nullptr); if (message) { const QString result = QString::fromWCharArray(message).trimmed(); LocalFree(static_cast<HLOCAL>(message)); diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 6fc90035ed..0ebe5bd413 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -148,7 +148,7 @@ void eatMouseMove() Base classes for native dialogs (using the CLSID-based dialog interfaces "IFileDialog", etc. available from Windows - Vista on) that mimick the behaviour of their QDialog + Vista on) that mimic the behavior of their QDialog counterparts as close as possible. Instances of derived classes are controlled by diff --git a/src/plugins/platforms/windows/qwindowsdrag.cpp b/src/plugins/platforms/windows/qwindowsdrag.cpp index ba049cf359..612e8cd90f 100644 --- a/src/plugins/platforms/windows/qwindowsdrag.cpp +++ b/src/plugins/platforms/windows/qwindowsdrag.cpp @@ -420,7 +420,7 @@ QWindowsOleDropSource::QueryContinueDrag(BOOL fEscapePressed, DWORD grfKeyState) } /*! - \brief Give feedback: Change cursor accoding to action. + \brief Give feedback: Change cursor according to action. */ QT_ENSURE_STACK_ALIGNED_FOR_SSE STDMETHODIMP diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 9820d1ec2c..9d9180e4f5 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2047,7 +2047,7 @@ HDC QWindowsWindow::getDC() } /*! - Relases the HDC for the window or does nothing in + Releases the HDC for the window or does nothing in case it was obtained from WinAPI BeginPaint within a WM_PAINT event. \sa getDC() @@ -2694,7 +2694,7 @@ void QWindowsWindow::getSizeHints(MINMAXINFO *mmi) const mmi->ptMaxSize.x = availableGeometry.width(); // If you have the taskbar on top, or on the left you don't want it at (0,0): - QPoint availablePositionDiff = geometry.topLeft() - availableGeometry.topLeft(); + QPoint availablePositionDiff = availableGeometry.topLeft() - geometry.topLeft(); mmi->ptMaxPosition.x = availablePositionDiff.x(); mmi->ptMaxPosition.y = availablePositionDiff.y(); if (!m_data.flags.testFlag(Qt::FramelessWindowHint)) { diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp index 93b9622655..50888d4a8e 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp @@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE using namespace QWindowsUiAutomation; +bool QWindowsUiaAccessibility::m_accessibleActive = false; QWindowsUiaAccessibility::QWindowsUiaAccessibility() { @@ -72,6 +73,7 @@ bool QWindowsUiaAccessibility::handleWmGetObject(HWND hwnd, WPARAM wParam, LPARA { // Start handling accessibility internally QGuiApplicationPrivate::platformIntegration()->accessibility()->setActive(true); + m_accessibleActive = true; // Ignoring all requests while starting up / shutting down if (QCoreApplication::startingUp() || QCoreApplication::closingDown()) @@ -131,6 +133,11 @@ void QWindowsUiaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event if (!event) return; + // Ignore events sent before the first UI Automation + // request or while QAccessible is being activated. + if (!m_accessibleActive) + return; + switch (event->type()) { case QAccessible::PopupMenuStart: playSystemSound(QStringLiteral("MenuPopup")); diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.h b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.h index 48b4f9fa6a..ac01a51e76 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.h +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.h @@ -56,6 +56,8 @@ public: virtual ~QWindowsUiaAccessibility(); static bool handleWmGetObject(HWND hwnd, WPARAM wParam, LPARAM lParam, LRESULT *lResult); void notifyAccessibilityUpdate(QAccessibleEvent *event) override; +private: + static bool m_accessibleActive; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp index 3bb0d08da9..754ded14f1 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp @@ -108,19 +108,11 @@ void QWindowsUiaMainProvider::notifyFocusChange(QAccessibleEvent *event) { if (QAccessibleInterface *accessible = event->accessibleInterface()) { // If this is a table/tree/list, raise event for the focused cell/item instead. - if (accessible->tableInterface()) { - int count = accessible->childCount(); - for (int i = 0; i < count; ++i) { - QAccessibleInterface *item = accessible->child(i); - if (item && item->isValid() && item->state().focused) { - accessible = item; - break; - } - } - } - if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) { + if (accessible->tableInterface()) + if (QAccessibleInterface *child = accessible->focusChild()) + accessible = child; + if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) QWindowsUiaWrapper::instance()->raiseAutomationEvent(provider, UIA_AutomationFocusChangedEventId); - } } } @@ -214,12 +206,16 @@ void QWindowsUiaMainProvider::notifyValueChange(QAccessibleValueChangeEvent *eve void QWindowsUiaMainProvider::notifyNameChange(QAccessibleEvent *event) { if (QAccessibleInterface *accessible = event->accessibleInterface()) { - if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) { - VARIANT oldVal, newVal; - clearVariant(&oldVal); - setVariantString(accessible->text(QAccessible::Name), &newVal); - QWindowsUiaWrapper::instance()->raiseAutomationPropertyChangedEvent(provider, UIA_NamePropertyId, oldVal, newVal); - ::SysFreeString(newVal.bstrVal); + // Restrict notification to combo boxes, which need it for accessibility, + // in order to avoid slowdowns with unnecessary notifications. + if (accessible->role() == QAccessible::ComboBox) { + if (QWindowsUiaMainProvider *provider = providerForAccessible(accessible)) { + VARIANT oldVal, newVal; + clearVariant(&oldVal); + setVariantString(accessible->text(QAccessible::Name), &newVal); + QWindowsUiaWrapper::instance()->raiseAutomationPropertyChangedEvent(provider, UIA_NamePropertyId, oldVal, newVal); + ::SysFreeString(newVal.bstrVal); + } } } } |