diff options
author | Michal Klocek <michal.klocek@qt.io> | 2021-10-13 20:22:52 +0200 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2021-11-10 19:49:50 +0000 |
commit | e02563066fe270205139f8dbc0b08a941874fe69 (patch) | |
tree | bde8f32cf94145c8f93295e220b2b87c3072e2f3 /src | |
parent | 30a7d8d20dd79e88cdba791d78be6297fceaa875 (diff) |
Check if xkb extension is present
According to docs:
"You must call XkbQueryExtension or XkbOpenDisplay
before using any other Xkb library interfaces"
Task-number: QTBUG-97472
Pick-to: 6.2
Change-Id: I84c1bc49b077224a93d9f8d7a9ac29fe089de13e
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ozone/ozone_platform_qt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp index 8dbacfb2f..33d7bd992 100644 --- a/src/core/ozone/ozone_platform_qt.cpp +++ b/src/core/ozone/ozone_platform_qt.cpp @@ -160,6 +160,12 @@ static std::string getCurrentKeyboardLayout() if (dpy == nullptr) return std::string(); + int d; + if (!XkbQueryExtension(dpy, &d, &d, &d, &d, &d)) { + // no Xkb extension + return std::string(); + } + XkbStateRec state; if (XkbGetState(dpy, XkbUseCoreKbd, &state) != 0) return std::string(); |