Commit 9577fd5c authored by Méven Car's avatar Méven Car
Browse files

KCM Behavior: in Wayland allow to disable primary selection

Aka middle click pasting

CCBUG: 441668
parent 8ebddaa2
Pipeline #192767 passed with stage
in 3 minutes and 13 seconds
File mode changed from 100644 to 100755
......@@ -184,6 +184,27 @@ KCM.SimpleKCM {
}
}
Item {
Kirigami.FormData.isSection: true
visible: primarySelectionRadio.visible
}
RowLayout {
Kirigami.FormData.label: i18n("Middle Click:")
QQC2.CheckBox {
id: primarySelectionRadio
visible: kcm.isWayland
text: i18n("Paste selected text")
checked: kcm.kwinSettings.primarySelection
onToggled: kcm.kwinSettings.primarySelection = checked
KCM.SettingStateBinding {
configObject: kcm.kwinSettings
settingName: "primarySelection"
}
}
}
Item {
Kirigami.FormData.isSection: true
}
......
......@@ -66,12 +66,23 @@ void KCMWorkspaceOptions::save()
{
ManagedConfigModule::save();
QDBusMessage message = QDBusMessage::createSignal("/KGlobalSettings", "org.kde.KGlobalSettings", "notifyChange");
QList<QVariant> args;
args.append(3 /*KGlobalSettings::SettingsChanged*/);
args.append(0 /*GlobalSettings::SettingsCategory::SETTINGS_MOUSE*/);
message.setArguments(args);
QDBusConnection::sessionBus().send(message);
{
QDBusMessage message = QDBusMessage::createSignal("/KGlobalSettings", "org.kde.KGlobalSettings", "notifyChange");
QList<QVariant> args;
args.append(3 /*KGlobalSettings::SettingsChanged*/);
args.append(0 /*GlobalSettings::SettingsCategory::SETTINGS_MOUSE*/);
message.setArguments(args);
QDBusConnection::sessionBus().send(message);
}
{
QDBusMessage message = QDBusMessage::createSignal(QStringLiteral("/kwinrc"), QStringLiteral("org.kde.kconfig.notify"), QStringLiteral("ConfigChanged"));
const QHash<QString, QByteArrayList> changes = {
{QStringLiteral("Wayland"), {"EnablePrimarySelection"}},
};
message.setArguments({QVariant::fromValue(changes)});
QDBusConnection::sessionBus().send(message);
}
}
#include "moc_workspaceoptions.cpp"
......
......@@ -10,4 +10,10 @@
<default>auto</default>
</entry>
</group>
<group name="Wayland">
<entry name="primarySelection" key="EnablePrimarySelection" type="bool">
<label>Enable middle click selection pasting</label>
<default>true</default>
</entry>
</group>
</kcfg>
Supports Markdown
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