summaryrefslogtreecommitdiff
path: root/src/client/qwaylandintegration.cpp
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2017-09-15 18:34:49 +0200
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2018-10-15 14:32:43 +0000
commit0761173a046f8f10cc185cff9c524ae6a5284556 (patch)
tree9d765ce9d784a85d2cbcc5f714372d0cd45396f8 /src/client/qwaylandintegration.cpp
parent3d02f3ad3339a6a711cadee35244d24c1ba913e2 (diff)
downloadqtwayland-0761173a046f8f10cc185cff9c524ae6a5284556.tar.gz
Load the Linux SPI Accessibility bridge
This is mostly a copy of XCB's atspi brige loading, only it creates the original QPlatformAccessility() instance if the atspi bridge is not available, to match the current behavior. This also moves accesibility module to be lazy-loaded to match both Mir and XCB QPAs. Change-Id: I7b7ccadbec3760ab8a9449124db0db3f28c1f355 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/client/qwaylandintegration.cpp')
-rw-r--r--src/client/qwaylandintegration.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp
index d2fa8568..c3163ee3 100644
--- a/src/client/qwaylandintegration.cpp
+++ b/src/client/qwaylandintegration.cpp
@@ -86,6 +86,10 @@
#include "qwaylandinputdeviceintegration_p.h"
#include "qwaylandinputdeviceintegrationfactory_p.h"
+#ifndef QT_NO_ACCESSIBILITY_ATSPI_BRIDGE
+#include <QtLinuxAccessibilitySupport/private/bridge_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
@@ -129,9 +133,6 @@ QWaylandIntegration::QWaylandIntegration()
: mFontDb(new QGenericUnixFontDatabase())
#endif
, mNativeInterface(new QWaylandNativeInterface(this))
-#if QT_CONFIG(accessibility)
- , mAccessibility(new QPlatformAccessibility())
-#endif
{
initializeInputDeviceIntegration();
mDisplay.reset(new QWaylandDisplay(this));
@@ -277,6 +278,15 @@ QVariant QWaylandIntegration::styleHint(StyleHint hint) const
#if QT_CONFIG(accessibility)
QPlatformAccessibility *QWaylandIntegration::accessibility() const
{
+ if (!mAccessibility) {
+#ifndef QT_NO_ACCESSIBILITY_ATSPI_BRIDGE
+ Q_ASSERT_X(QCoreApplication::eventDispatcher(), "QXcbIntegration",
+ "Initializing accessibility without event-dispatcher!");
+ mAccessibility.reset(new QSpiAccessibleBridge());
+#else
+ mAccessibility.reset(new QPlatformAccessibility());
+#endif
+ }
return mAccessibility.data();
}
#endif