[keyboard] Send DBus signal to KWin for new keyboard layout

This commit is contained in:
Adriaan de Groot 2024-09-07 11:20:33 -04:00
parent 6498f9e0d1
commit cde6acd224

View File

@ -378,14 +378,23 @@ Config::applyKWin()
const QString layouts = join( m_selectedLayout, m_additionalLayoutInfo.additionalLayout ); const QString layouts = join( m_selectedLayout, m_additionalLayoutInfo.additionalLayout );
const QString variants = join( m_selectedVariant, m_additionalLayoutInfo.additionalVariant ); const QString variants = join( m_selectedVariant, m_additionalLayoutInfo.additionalVariant );
bool updated = false;
for ( const auto& path : paths ) for ( const auto& path : paths )
{ {
const QString candidate = path + QStringLiteral( "/kxkbrc" ); const QString candidate = path + QStringLiteral( "/kxkbrc" );
if ( rewriteKWin( candidate, m_selectedModel, layouts, variants ) ) if ( rewriteKWin( candidate, m_selectedModel, layouts, variants ) )
{ {
updated = true;
break; break;
} }
} }
if ( updated )
{
auto kwin = QDBusMessage::createSignal(
QStringLiteral( "/Layouts" ), QStringLiteral( "org.kde.keyboard" ), QStringLiteral( "reloadConfig" ) );
QDBusConnection::sessionBus().send( kwin );
}
} }