summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm19
-rw-r--r--src/plugins/platforms/wasm/qwasmaccessibility.cpp19
-rw-r--r--src/plugins/platforms/wasm/qwasmaccessibility.h1
-rw-r--r--src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1.cpp1
-rw-r--r--src/plugins/platforms/wayland/qwaylandinputdevice.cpp4
-rw-r--r--src/plugins/platforms/windows/qwindowsscreen.cpp5
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiamainprovider.cpp15
-rw-r--r--src/plugins/platforms/windows/uiautomation/qwindowsuiautils.cpp1
-rw-r--r--src/plugins/platforms/xcb/qxcbatom.cpp1
10 files changed, 64 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index 08c9f5d5ba2..2989b4d6df3 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -161,6 +161,7 @@ static void populateRoleMap()
roleMap[QAccessible::Graphic] = NSAccessibilityImageRole;
roleMap[QAccessible::Tree] = NSAccessibilityOutlineRole;
roleMap[QAccessible::BlockQuote] = NSAccessibilityGroupRole;
+ roleMap[QAccessible::LayeredPane] = NSAccessibilityGroupRole;
}
/*
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 144c0519155..238f2ea2307 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -714,6 +714,25 @@ static void convertLineOffset(QAccessibleTextInterface *text, int *line, int *of
iface->setText(QAccessible::Description, QString::fromNSString(label));
}
+- (NSAccessibilityOrientation)accessibilityOrientation {
+ QAccessibleInterface *iface = self.qtInterface;
+ if (!iface)
+ return NSAccessibilityOrientationUnknown;
+
+ NSAccessibilityOrientation nsOrientation = NSAccessibilityOrientationUnknown;
+ if (QAccessibleAttributesInterface *attributesIface = iface->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>();
+ nsOrientation = orientation == Qt::Horizontal ? NSAccessibilityOrientationHorizontal
+ : NSAccessibilityOrientationVertical;
+ }
+ }
+ return nsOrientation;
+}
+
- (id) accessibilityValue {
if (QAccessibleInterface *iface = self.qtInterface) {
// VoiceOver asks for the value attribute for all elements. Return nil
diff --git a/src/plugins/platforms/wasm/qwasmaccessibility.cpp b/src/plugins/platforms/wasm/qwasmaccessibility.cpp
index 5fa79482217..a87c33c8346 100644
--- a/src/plugins/platforms/wasm/qwasmaccessibility.cpp
+++ b/src/plugins/platforms/wasm/qwasmaccessibility.cpp
@@ -401,6 +401,7 @@ emscripten::val QWasmAccessibility::createHtmlElement(QAccessibleInterface *ifac
case QAccessible::PageTabList:{
element = document.call<emscripten::val>("createElement", std::string("div"));
setAttribute(element, "role", "tablist");
+ setHtmlElementOrientation(element, iface);
m_elements[iface] = element;
@@ -423,6 +424,7 @@ emscripten::val QWasmAccessibility::createHtmlElement(QAccessibleInterface *ifac
element = document.call<emscripten::val>("createElement", std::string("div"));
setAttribute(element, "role", "scrollbar");
setAttribute(element, "aria-valuenow", valueString);
+ setHtmlElementOrientation(element, iface);
addEventListener(iface, element, "change");
} break;
@@ -437,6 +439,7 @@ emscripten::val QWasmAccessibility::createHtmlElement(QAccessibleInterface *ifac
element = document.call<emscripten::val>("createElement", std::string("div"));
setAttribute(element, "role", "toolbar");
setAttribute(element, "title", text.toStdString());
+ setHtmlElementOrientation(element, iface);
addEventListener(iface, element, "click");
}break;
case QAccessible::MenuItem:
@@ -453,6 +456,7 @@ emscripten::val QWasmAccessibility::createHtmlElement(QAccessibleInterface *ifac
element = document.call<emscripten::val>("createElement", std::string("div"));
setAttribute(element, "role", "menubar");
setAttribute(element, "title", text.toStdString());
+ setHtmlElementOrientation(element, iface);
m_elements[iface] = element;
for (int i = 0; i < iface->childCount(); ++i) {
@@ -661,6 +665,21 @@ void QWasmAccessibility::setHtmlElementDisabled(QAccessibleInterface *iface)
setAttribute(element, "aria-disabled", iface->state().disabled);
}
+void QWasmAccessibility::setHtmlElementOrientation(emscripten::val element, QAccessibleInterface *iface)
+{
+ Q_ASSERT(iface);
+ if (QAccessibleAttributesInterface *attributesIface = iface->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>();
+ const std::string value = orientation == Qt::Horizontal ? "horizontal" : "vertical";
+ setAttribute(element, "aria-orientation", value);
+ }
+ }
+}
+
void QWasmAccessibility::handleStaticTextUpdate(QAccessibleEvent *event)
{
switch (event->type()) {
diff --git a/src/plugins/platforms/wasm/qwasmaccessibility.h b/src/plugins/platforms/wasm/qwasmaccessibility.h
index 26f3e0e9afe..ddbfec918d6 100644
--- a/src/plugins/platforms/wasm/qwasmaccessibility.h
+++ b/src/plugins/platforms/wasm/qwasmaccessibility.h
@@ -77,6 +77,7 @@ private:
void setHtmlElementTextNameLE(QAccessibleInterface *iface);
void setHtmlElementFocus(QAccessibleInterface *iface);
void setHtmlElementDisabled(QAccessibleInterface *iface);
+ void setHtmlElementOrientation(emscripten::val element, QAccessibleInterface *iface);
void handleStaticTextUpdate(QAccessibleEvent *event);
void handleButtonUpdate(QAccessibleEvent *event);
diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1.cpp
index 84ecc289c59..9aa8af39090 100644
--- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1.cpp
+++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgtopleveliconv1.cpp
@@ -2,7 +2,6 @@
// Copyright (C) 2024 David Edmundson <[email protected]>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
-#include "qwaylandshmbackingstore_p.h"
#include "qwaylandxdgtopleveliconv1_p.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
diff --git a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
index 6ce43714a35..34b32da289c 100644
--- a/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
+++ b/src/plugins/platforms/wayland/qwaylandinputdevice.cpp
@@ -729,11 +729,11 @@ public:
void QWaylandInputDevice::Pointer::pointer_leave(uint32_t serial, struct wl_surface *surface)
{
+ Q_UNUSED(serial);
+
invalidateFocus();
mButtons = Qt::NoButton;
- mParent->mSerial = serial;
-
// The event may arrive after destroying the window, indicated by
// a null surface.
if (!surface)
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/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);
diff --git a/src/plugins/platforms/xcb/qxcbatom.cpp b/src/plugins/platforms/xcb/qxcbatom.cpp
index 5f712d33d56..e609b84ad5f 100644
--- a/src/plugins/platforms/xcb/qxcbatom.cpp
+++ b/src/plugins/platforms/xcb/qxcbatom.cpp
@@ -9,6 +9,7 @@
#include <string.h>
#include <algorithm>
+#include <cstdlib>
static const char *xcb_atomnames = {
// window-manager <-> client protocols