Commit 9021b3cb authored by Andrey Butirsky's avatar Andrey Butirsky

fix: keyboard layout applet: no backward scrolling

Add scrolling in opposite direction.

Along the way, remove OSD as it doesn't belong here and for consistency
with legacy applet.
Instead, KeyboardInputRedirection::processKey() should be fixed to have
common OSD behaviour for Wayland and X11.
parent 38db66f2
......@@ -202,20 +202,12 @@ void KeyboardDaemon::layoutMapChanged()
void KeyboardDaemon::switchToNextLayout()
{
qCDebug(KCM_KEYBOARD) << "Toggling layout";
X11Helper::switchToNextLayout();
LayoutUnit newLayout = X11Helper::getCurrentLayout();
QDBusMessage msg = QDBusMessage::createMethodCall(
QStringLiteral("org.kde.plasmashell"),
QStringLiteral("/org/kde/osdService"),
QStringLiteral("org.kde.osdService"),
QStringLiteral("kbdLayoutChanged"));
msg << Flags::getLongText(newLayout, rules);
X11Helper::scrollLayouts(1);
}
QDBusConnection::sessionBus().asyncCall(msg);
void KeyboardDaemon::switchToPreviousLayout()
{
X11Helper::scrollLayouts(-1);
}
bool KeyboardDaemon::setLayout(QAction* action)
......
......@@ -61,6 +61,7 @@ private Q_SLOTS:
public Q_SLOTS:
Q_SCRIPTABLE void switchToNextLayout();
Q_SCRIPTABLE void switchToPreviousLayout();
Q_SCRIPTABLE bool setLayout(uint index);
Q_SCRIPTABLE uint getLayout() const;
Q_SCRIPTABLE QString getLayoutLongName() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment