diff --git a/src/qt/xkbcommon_wl_keyboard.cpp b/src/qt/xkbcommon_wl_keyboard.cpp index 2dda6368a..c6736f2d4 100644 --- a/src/qt/xkbcommon_wl_keyboard.cpp +++ b/src/qt/xkbcommon_wl_keyboard.cpp @@ -55,7 +55,7 @@ xkbcommon_wl_set_keymap() return; } } - xkbcommon_close(); + xkbcommon_close(); /* none found */ } static void diff --git a/src/qt/xkbcommon_x11_keyboard.cpp b/src/qt/xkbcommon_x11_keyboard.cpp index 8cba2c4d1..8e0167518 100644 --- a/src/qt/xkbcommon_x11_keyboard.cpp +++ b/src/qt/xkbcommon_x11_keyboard.cpp @@ -33,7 +33,9 @@ extern "C" { }; #include "xkbcommon_keyboard.hpp" +#include #include +#include void xkbcommon_x11_init() @@ -43,9 +45,9 @@ xkbcommon_x11_init() int32_t core_kbd_device_id; struct xkb_keymap *keymap; - conn = xcb_connect(NULL, NULL); - if (!conn || xcb_connection_has_error(conn)) { - qWarning() << "XKB Keyboard: X server connection failed with error" << (conn ? xcb_connection_has_error(conn) : -1); + conn = (xcb_connection_t *) QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("connection"); + if (!conn) { + qWarning() << "XKB Keyboard: X server connection failed"; return; } @@ -55,13 +57,13 @@ xkbcommon_x11_init() NULL, NULL, NULL, NULL); if (!ret) { qWarning() << "XKB Keyboard: XKB extension setup failed"; - goto err_conn; + return; } ctx = xkb_context_new(XKB_CONTEXT_NO_FLAGS); if (!ctx) { qWarning() << "XKB Keyboard: XKB context creation failed"; - goto err_conn; + return; } core_kbd_device_id = xkb_x11_get_core_keyboard_device_id(conn); @@ -77,10 +79,8 @@ xkbcommon_x11_init() } xkbcommon_init(keymap); - goto err_conn; + return; err_ctx: xkb_context_unref(ctx); -err_conn: - xcb_disconnect(conn); }