plugins/qpa: implement platform accessibility

This allows screen readers to read window titles in a tabbox.

BUG: 472643
FIXED-IN: 5.27.9
master
Fushan Wen 1 year ago
parent 1fea924c34
commit f0c8a0c482
No known key found for this signature in database
GPG Key ID: 2E48D1487C91DCAA

@ -7,6 +7,7 @@
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "integration.h"
#include "backingstore.h"
#include "eglplatformcontext.h"
@ -24,6 +25,7 @@
#include <QTimer>
#include <QtConcurrentRun>
#include <qpa/qplatformaccessibility.h>
#include <qpa/qplatformnativeinterface.h>
#include <qpa/qplatformwindow.h>
#include <qpa/qwindowsysteminterface.h>
@ -31,6 +33,7 @@
#include <QtGui/private/qgenericunixeventdispatcher_p.h>
#include <QtGui/private/qgenericunixfontdatabase_p.h>
#include <QtGui/private/qgenericunixthemes_p.h>
#include <QtGui/private/qspiaccessiblebridge_p.h>
#include <QtGui/private/qunixeventdispatcher_qpa_p.h>
namespace KWin
@ -154,6 +157,14 @@ QPlatformOpenGLContext *Integration::createPlatformOpenGLContext(QOpenGLContext
return nullptr;
}
QPlatformAccessibility *Integration::accessibility() const
{
if (!m_accessibility) {
m_accessibility.reset(new QSpiAccessibleBridge());
}
return m_accessibility.get();
}
void Integration::handleWorkspaceCreated()
{
connect(workspace(), &Workspace::outputAdded,

@ -41,6 +41,7 @@ public:
QStringList themeNames() const override;
QPlatformTheme *createPlatformTheme(const QString &name) const override;
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
QPlatformAccessibility *accessibility() const override;
QPlatformNativeInterface *nativeInterface() const override;
QPlatformServices *services() const override;
void initialize() override;
@ -54,6 +55,7 @@ private Q_SLOTS:
private:
std::unique_ptr<QPlatformFontDatabase> m_fontDb;
mutable std::unique_ptr<QPlatformAccessibility> m_accessibility;
std::unique_ptr<QPlatformNativeInterface> m_nativeInterface;
QPlatformPlaceholderScreen *m_dummyScreen = nullptr;
QHash<Output *, Screen *> m_screens;

Loading…
Cancel
Save