diff options
author | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-08-03 15:00:39 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@qt.io> | 2018-08-17 09:59:31 +0000 |
commit | 0e63111416e3407c4fa3eac33ae69028216cf1b7 (patch) | |
tree | 532b9db605a480042bd8c1e730301dc79b400f1f /src/plugins/platforms/xcb/qxcbnativeinterface.cpp | |
parent | b9a0276a79856ff4eb329b8c79925bfc41925c1c (diff) |
xcb: avoid unnecessary InternAtom requests
QXcbConnection::internAtom() creates the atom if it does not exist. The
lifetime of an atom is not tied to the interning client. Atoms remain
defined until server reset (lost connection, restart).
So create the atom once via QXcbConnection::initializeAllAtoms(), and
later fetch the atom value from local array, instead of repeating
InternAtom requests.
Change-Id: I3cae21895febad6e5daf8c32e72612202baaad64
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 3d2197796f..98bedea48a 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -408,7 +408,7 @@ void *QXcbNativeInterface::atspiBus() QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); QXcbConnection *defaultConnection = integration->defaultConnection(); if (defaultConnection) { - xcb_atom_t atspiBusAtom = defaultConnection->internAtom("AT_SPI_BUS"); + auto atspiBusAtom = defaultConnection->atom(QXcbAtom::AT_SPI_BUS); auto reply = Q_XCB_REPLY(xcb_get_property, defaultConnection->xcb_connection(), false, defaultConnection->rootWindow(), atspiBusAtom, XCB_ATOM_STRING, 0, 128); |