From 3429617662c6ddc2d992bdd90721a14eeae40565 Mon Sep 17 00:00:00 2001 From: Bhushan Shah Date: Fri, 6 Nov 2020 10:16:26 +0530 Subject: [PATCH] adapt to changes in seat and keyboard interface Now several methods of keyboard_interface are public and wrappers for them are removed from the seat_interface. --- autotests/integration/globalshortcuts_test.cpp | 2 +- autotests/integration/lockscreen.cpp | 2 +- input.cpp | 10 +++++----- inputmethod.cpp | 4 ++-- xkb.cpp | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/autotests/integration/globalshortcuts_test.cpp b/autotests/integration/globalshortcuts_test.cpp index 1f287bb02e..a4f76d1648 100644 --- a/autotests/integration/globalshortcuts_test.cpp +++ b/autotests/integration/globalshortcuts_test.cpp @@ -117,7 +117,7 @@ void GlobalShortcutsTest::testRepeatedTrigger() input()->registerShortcut(Qt::Key_Percent, action.data()); // we need to configure the key repeat first. It is only enabled on libinput - waylandServer()->seat()->setKeyRepeatInfo(25, 300); + waylandServer()->seat()->keyboard()->setRepeatInfo(25, 300); // press shift+5 quint32 timestamp = 0; diff --git a/autotests/integration/lockscreen.cpp b/autotests/integration/lockscreen.cpp index 89f97e449f..ffec6b476e 100644 --- a/autotests/integration/lockscreen.cpp +++ b/autotests/integration/lockscreen.cpp @@ -528,7 +528,7 @@ void LockScreenTest::testEffectsKeyboardAutorepeat() effects->grabKeyboard(effect.data()); // we need to configure the key repeat first. It is only enabled on libinput - waylandServer()->seat()->setKeyRepeatInfo(25, 300); + waylandServer()->seat()->keyboard()->setRepeatInfo(25, 300); quint32 timestamp = 1; KEYPRESS(KEY_A); diff --git a/input.cpp b/input.cpp index 641fbfd000..b8cd9340a7 100644 --- a/input.cpp +++ b/input.cpp @@ -211,10 +211,10 @@ void InputEventFilter::passToWaylandServer(QKeyEvent *event) } switch (event->type()) { case QEvent::KeyPress: - waylandServer()->seat()->keyPressed(event->nativeScanCode()); + waylandServer()->seat()->keyboard()->keyPressed(event->nativeScanCode()); break; case QEvent::KeyRelease: - waylandServer()->seat()->keyReleased(event->nativeScanCode()); + waylandServer()->seat()->keyboard()->keyReleased(event->nativeScanCode()); break; default: break; @@ -311,10 +311,10 @@ public: } switch (event->type()) { case QEvent::KeyPress: - seat->keyPressed(event->nativeScanCode()); + seat->keyboard()->keyPressed(event->nativeScanCode()); break; case QEvent::KeyRelease: - seat->keyReleased(event->nativeScanCode()); + seat->keyboard()->keyReleased(event->nativeScanCode()); break; default: break; @@ -2159,7 +2159,7 @@ void InputRedirection::reconfigure() const int rate = config.readEntry("RepeatRate", 25); const bool enabled = config.readEntry("KeyboardRepeating", 0) == 0; - waylandServer()->seat()->setKeyRepeatInfo(enabled ? rate : 0, delay); + waylandServer()->seat()->keyboard()->setRepeatInfo(enabled ? rate : 0, delay); } } diff --git a/inputmethod.cpp b/inputmethod.cpp index 9c70d8d4f1..a29f790fdc 100644 --- a/inputmethod.cpp +++ b/inputmethod.cpp @@ -321,9 +321,9 @@ static void keysymReceived(quint32 serial, quint32 time, quint32 sym, bool press auto t3 = waylandServer()->seat()->textInputV3(); if (t3 && t3->isEnabled()) { if (pressed) { - waylandServer()->seat()->keyPressed(keysymToKeycode(sym)); + waylandServer()->seat()->keyboard()->keyPressed(keysymToKeycode(sym)); } else { - waylandServer()->seat()->keyReleased(keysymToKeycode(sym)); + waylandServer()->seat()->keyboard()->keyReleased(keysymToKeycode(sym)); } return; } diff --git a/xkb.cpp b/xkb.cpp index 10473a2a6c..d18075f8cc 100644 --- a/xkb.cpp +++ b/xkb.cpp @@ -285,7 +285,7 @@ void Xkb::createKeymapFile() if (keymapString.isNull()) { return; } - m_seat->setKeymapData(keymapString.data()); + m_seat->keyboard()->setKeymap(keymapString.data()); } void Xkb::updateModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) @@ -374,10 +374,10 @@ void Xkb::forwardModifiers() if (!m_seat) { return; } - m_seat->updateKeyboardModifiers(m_modifierState.depressed, - m_modifierState.latched, - m_modifierState.locked, - m_currentLayout); + m_seat->keyboard()->updateModifiers(m_modifierState.depressed, + m_modifierState.latched, + m_modifierState.locked, + m_currentLayout); } QString Xkb::layoutName() const