summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbkeyboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.h')
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h
index 8ea16f099b..2e2e26367d 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.h
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h
@@ -90,10 +90,7 @@ protected:
QString lookupString(struct xkb_state *state, xcb_keycode_t code) const;
int keysymToQtKey(xcb_keysym_t keysym) const;
int keysymToQtKey(xcb_keysym_t keysym, Qt::KeyboardModifiers &modifiers, const QString &text) const;
- void printKeymapError(const char *error) const;
- void readXKBConfig();
- void clearXKBConfig();
struct xkb_keymap *keymapFromCore();
// when XKEYBOARD not present on the X server
@@ -111,14 +108,8 @@ private:
void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state);
bool m_config = false;
- bool m_keymap_is_core = false;
xcb_keycode_t m_autorepeat_code = 0;
- struct xkb_context *xkb_context = nullptr;
- struct xkb_keymap *xkb_keymap = nullptr;
- struct xkb_state *xkb_state = nullptr;
- struct xkb_rule_names xkb_names;
-
struct _mod_masks {
uint alt;
uint altgr;
@@ -151,7 +142,19 @@ private:
struct XKBStateDeleter {
void operator()(struct xkb_state *state) const { return xkb_state_unref(state); }
};
+ struct XKBKeymapDeleter {
+ void operator()(struct xkb_keymap *keymap) const { return xkb_keymap_unref(keymap); }
+ };
+ struct XKBContextDeleter {
+ void operator()(struct xkb_context *context) const { return xkb_context_unref(context); }
+ };
using ScopedXKBState = std::unique_ptr<struct xkb_state, XKBStateDeleter>;
+ using ScopedXKBKeymap = std::unique_ptr<struct xkb_keymap, XKBKeymapDeleter>;
+ using ScopedXKBContext = std::unique_ptr<struct xkb_context, XKBContextDeleter>;
+
+ ScopedXKBState m_xkbState;
+ ScopedXKBKeymap m_xkbKeymap;
+ ScopedXKBContext m_xkbContext;
};
QT_END_NAMESPACE