Changeset View
Changeset View
Standalone View
Standalone View
keyboard_layout.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 89 | { | |||
---|---|---|---|---|---|
93 | } | 93 | } | ||
94 | m_layout = layout; | 94 | m_layout = layout; | ||
95 | notifyLayoutChange(); | 95 | notifyLayoutChange(); | ||
96 | } | 96 | } | ||
97 | 97 | | |||
98 | void KeyboardLayout::notifyLayoutChange() | 98 | void KeyboardLayout::notifyLayoutChange() | ||
99 | { | 99 | { | ||
100 | // notify OSD service about the new layout | 100 | // notify OSD service about the new layout | ||
101 | if (!kwinApp()->usesLibinput()) { | | |||
102 | return; | | |||
103 | } | | |||
104 | // only if kwin is in charge of keyboard input | | |||
105 | QDBusMessage msg = QDBusMessage::createMethodCall( | 101 | QDBusMessage msg = QDBusMessage::createMethodCall( | ||
106 | QStringLiteral("org.kde.plasmashell"), | 102 | QStringLiteral("org.kde.plasmashell"), | ||
107 | QStringLiteral("/org/kde/osdService"), | 103 | QStringLiteral("/org/kde/osdService"), | ||
108 | QStringLiteral("org.kde.osdService"), | 104 | QStringLiteral("org.kde.osdService"), | ||
109 | QStringLiteral("kbdLayoutChanged")); | 105 | QStringLiteral("kbdLayoutChanged")); | ||
110 | 106 | | |||
111 | msg << i18nd("xkeyboard-config", m_xkb->layoutName().toUtf8().constData()); | 107 | msg << i18nd("xkeyboard-config", m_xkb->layoutName().toUtf8().constData()); | ||
112 | 108 | | |||
113 | QDBusConnection::sessionBus().asyncCall(msg); | 109 | QDBusConnection::sessionBus().asyncCall(msg); | ||
114 | } | 110 | } | ||
115 | 111 | | |||
116 | } | 112 | } |