diff options
Diffstat (limited to 'src/plugins/platforms/windows')
4 files changed, 25 insertions, 2 deletions
| diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 53548622dfc..482810d5b7e 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -553,12 +553,14 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)      const bool orientationChanged = m_data.orientation != newData.orientation;      const bool primaryChanged = (newData.flags & QWindowsScreenData::PrimaryScreen)              && !(m_data.flags & QWindowsScreenData::PrimaryScreen); +    const bool refreshRateChanged = m_data.refreshRateHz != newData.refreshRateHz;      m_data.dpi = newData.dpi;      m_data.orientation = newData.orientation;      m_data.geometry = newData.geometry;      m_data.availableGeometry = newData.availableGeometry;      m_data.flags = (m_data.flags & ~QWindowsScreenData::PrimaryScreen)              | (newData.flags & QWindowsScreenData::PrimaryScreen); +    m_data.refreshRateHz = newData.refreshRateHz;      if (dpiChanged) {          QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(), @@ -573,6 +575,9 @@ void QWindowsScreen::handleChanges(const QWindowsScreenData &newData)      }      if (primaryChanged)          QWindowSystemInterface::handlePrimaryScreenChanged(this); + +    if (refreshRateChanged) +        QWindowSystemInterface::handleScreenRefreshRateChange(screen(), newData.refreshRateHz);  }  HMONITOR QWindowsScreen::handle() const diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 82a86d6ff3a..01716fba60c 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -4019,9 +4019,11 @@ void QWindowsWindow::requestUpdate()                      // request or we are waiting for the event loop to process                      // the Posted event on the GUI thread.                      if (m_vsyncUpdatePending.testAndSetAcquire(UpdateState::Requested, UpdateState::Posted)) { -                        QMetaObject::invokeMethod(w, [w] { +                        QWindowsWindow *oldSelf = this; +                        QMetaObject::invokeMethod(w, [w, oldSelf] { +                            // 'oldSelf' is only used for comparison, don't access it directly!                              auto *self = static_cast<QWindowsWindow *>(w->handle()); -                            if (self) { +                            if (self && self == oldSelf) {                                  // The platform window is still alive                                  self->m_vsyncUpdatePending.storeRelease(UpdateState::Ready);                                  self->deliverUpdateRequest(); diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp index 0144786ce5e..b7bf97f5c4b 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp @@ -654,6 +654,21 @@ HRESULT QWindowsUiaMainProvider::GetPropertyValue(PROPERTYID idProp, VARIANT *pR          *pRetVal = QComVariant{ name }.release();          break;      } +    case UIA_OrientationPropertyId: { +        OrientationType orientationType = OrientationType_None; +        if (QAccessibleAttributesInterface *attributesIface = accessible->attributesInterface()) { +            const QVariant orientationVariant = +                    attributesIface->attributeValue(QAccessible::Attribute::Orientation); +            if (orientationVariant.isValid()) { +                Q_ASSERT(orientationVariant.canConvert<Qt::Orientation>()); +                const Qt::Orientation orientation = orientationVariant.value<Qt::Orientation>(); +                orientationType = orientation == Qt::Horizontal ? OrientationType_Horizontal +                                                                : OrientationType_Vertical; +            } +        } +        *pRetVal = QComVariant{ long(orientationType) }.release(); +        break; +    }      case UIA_StyleIdAttributeId:          setStyle(accessible, pRetVal);          break; diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp index b2675d5b884..835499d3554 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp @@ -154,6 +154,7 @@ long roleToControlTypeId(QAccessible::Role role)          {QAccessible::WebDocument, UIA_DocumentControlTypeId},          {QAccessible::Heading, UIA_TextControlTypeId},          {QAccessible::BlockQuote, UIA_GroupControlTypeId}, +        {QAccessible::LayeredPane, UIA_PaneControlTypeId},      };      long controlType = mapping.value(role, UIA_CustomControlTypeId); | 
