diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2021-07-12 14:09:00 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-07-12 20:09:25 +0000 |
commit | 342a43b4003be531bcd28b5acf054901d9b02669 (patch) | |
tree | 52f1995cafd0dd9375962948f5292837ba4388ae /src | |
parent | 73bcb988877eb211892320a00a44c19005a2ddc1 (diff) |
Fix Keyboard.getLayoutMap() with cmake build
USE_X11 is disabled but we don't need it due to the USE_XKBCOMMON check.
Change-Id: Ief5ed178152da10ceef3d2c3a415647ce6d3aee6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7b7c4894151f3af05e635031a4626eeb04173bb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ozone/BUILD.gn | 2 | ||||
-rw-r--r-- | src/core/ozone/ozone_platform_qt.cpp | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/core/ozone/BUILD.gn b/src/core/ozone/BUILD.gn index a01728842..016d0a71d 100644 --- a/src/core/ozone/BUILD.gn +++ b/src/core/ozone/BUILD.gn @@ -20,7 +20,7 @@ source_set("qt") { defines = [ "OZONE_IMPLEMENTATION" ] - if (use_xkbcommon && use_x11) { + if (use_xkbcommon) { libs = [ "xkbfile" ] } } diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp index c547cf783..7e2dc4edc 100644 --- a/src/core/ozone/ozone_platform_qt.cpp +++ b/src/core/ozone/ozone_platform_qt.cpp @@ -59,7 +59,7 @@ #include "surface_factory_qt.h" #include "platform_window_qt.h" -#if BUILDFLAG(USE_XKBCOMMON) && defined(USE_X11) +#if BUILDFLAG(USE_XKBCOMMON) #include "ui/events/ozone/layout/xkb/xkb_evdev_codes.h" #include "ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h" @@ -67,7 +67,7 @@ #include <X11/extensions/XKBrules.h> extern void *GetQtXDisplay(); -#endif // BUILDFLAG(USE_XKBCOMMON) && defined(USE_X11) +#endif // BUILDFLAG(USE_XKBCOMMON) namespace ui { @@ -99,7 +99,7 @@ private: std::unique_ptr<InputController> input_controller_; std::unique_ptr<OverlayManagerOzone> overlay_manager_; -#if BUILDFLAG(USE_XKBCOMMON) && defined(USE_X11) +#if BUILDFLAG(USE_XKBCOMMON) XkbEvdevCodes m_xkbEvdevCodeConverter; #endif std::unique_ptr<KeyboardLayoutEngine> m_keyboardLayoutEngine; @@ -153,7 +153,7 @@ std::unique_ptr<display::NativeDisplayDelegate> OzonePlatformQt::CreateNativeDis return nullptr; } -#if BUILDFLAG(USE_XKBCOMMON) && defined(USE_X11) +#if BUILDFLAG(USE_XKBCOMMON) static std::string getCurrentKeyboardLayout() { Display *dpy = static_cast<Display *>(GetQtXDisplay()); @@ -190,7 +190,7 @@ static std::string getCurrentKeyboardLayout() layoutWithVariant = layoutWithVariant.append(variant); return layoutWithVariant; } -#endif // BUILDFLAG(USE_XKBCOMMON) && defined(USE_X11) +#endif // BUILDFLAG(USE_XKBCOMMON) void OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &) { @@ -199,7 +199,7 @@ void OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &) gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost()); input_controller_ = CreateStubInputController(); -#if BUILDFLAG(USE_XKBCOMMON) && defined(USE_X11) +#if BUILDFLAG(USE_XKBCOMMON) std::string layout = getCurrentKeyboardLayout(); if (layout.empty()) { m_keyboardLayoutEngine = std::make_unique<StubKeyboardLayoutEngine>(); @@ -209,7 +209,7 @@ void OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &) } #else m_keyboardLayoutEngine = std::make_unique<StubKeyboardLayoutEngine>(); -#endif // BUILDFLAG(USE_XKBCOMMON) && defined(USE_X11) +#endif // BUILDFLAG(USE_XKBCOMMON) KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(m_keyboardLayoutEngine.get()); } |