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.
This commit is contained in:
Bhushan Shah 2020-11-06 10:16:26 +05:30 committed by Bhushan Shah
parent 592c82abeb
commit 3429617662
5 changed files with 14 additions and 14 deletions

View file

@ -117,7 +117,7 @@ void GlobalShortcutsTest::testRepeatedTrigger()
input()->registerShortcut(Qt::Key_Percent, action.data()); input()->registerShortcut(Qt::Key_Percent, action.data());
// we need to configure the key repeat first. It is only enabled on libinput // 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 // press shift+5
quint32 timestamp = 0; quint32 timestamp = 0;

View file

@ -528,7 +528,7 @@ void LockScreenTest::testEffectsKeyboardAutorepeat()
effects->grabKeyboard(effect.data()); effects->grabKeyboard(effect.data());
// we need to configure the key repeat first. It is only enabled on libinput // 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; quint32 timestamp = 1;
KEYPRESS(KEY_A); KEYPRESS(KEY_A);

View file

@ -211,10 +211,10 @@ void InputEventFilter::passToWaylandServer(QKeyEvent *event)
} }
switch (event->type()) { switch (event->type()) {
case QEvent::KeyPress: case QEvent::KeyPress:
waylandServer()->seat()->keyPressed(event->nativeScanCode()); waylandServer()->seat()->keyboard()->keyPressed(event->nativeScanCode());
break; break;
case QEvent::KeyRelease: case QEvent::KeyRelease:
waylandServer()->seat()->keyReleased(event->nativeScanCode()); waylandServer()->seat()->keyboard()->keyReleased(event->nativeScanCode());
break; break;
default: default:
break; break;
@ -311,10 +311,10 @@ public:
} }
switch (event->type()) { switch (event->type()) {
case QEvent::KeyPress: case QEvent::KeyPress:
seat->keyPressed(event->nativeScanCode()); seat->keyboard()->keyPressed(event->nativeScanCode());
break; break;
case QEvent::KeyRelease: case QEvent::KeyRelease:
seat->keyReleased(event->nativeScanCode()); seat->keyboard()->keyReleased(event->nativeScanCode());
break; break;
default: default:
break; break;
@ -2159,7 +2159,7 @@ void InputRedirection::reconfigure()
const int rate = config.readEntry("RepeatRate", 25); const int rate = config.readEntry("RepeatRate", 25);
const bool enabled = config.readEntry("KeyboardRepeating", 0) == 0; const bool enabled = config.readEntry("KeyboardRepeating", 0) == 0;
waylandServer()->seat()->setKeyRepeatInfo(enabled ? rate : 0, delay); waylandServer()->seat()->keyboard()->setRepeatInfo(enabled ? rate : 0, delay);
} }
} }

View file

@ -321,9 +321,9 @@ static void keysymReceived(quint32 serial, quint32 time, quint32 sym, bool press
auto t3 = waylandServer()->seat()->textInputV3(); auto t3 = waylandServer()->seat()->textInputV3();
if (t3 && t3->isEnabled()) { if (t3 && t3->isEnabled()) {
if (pressed) { if (pressed) {
waylandServer()->seat()->keyPressed(keysymToKeycode(sym)); waylandServer()->seat()->keyboard()->keyPressed(keysymToKeycode(sym));
} else { } else {
waylandServer()->seat()->keyReleased(keysymToKeycode(sym)); waylandServer()->seat()->keyboard()->keyReleased(keysymToKeycode(sym));
} }
return; return;
} }

10
xkb.cpp
View file

@ -285,7 +285,7 @@ void Xkb::createKeymapFile()
if (keymapString.isNull()) { if (keymapString.isNull()) {
return; 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) 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) { if (!m_seat) {
return; return;
} }
m_seat->updateKeyboardModifiers(m_modifierState.depressed, m_seat->keyboard()->updateModifiers(m_modifierState.depressed,
m_modifierState.latched, m_modifierState.latched,
m_modifierState.locked, m_modifierState.locked,
m_currentLayout); m_currentLayout);
} }
QString Xkb::layoutName() const QString Xkb::layoutName() const