Warning, /plasma/kwin/src/kcms/xwayland/ui/main.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 
0008 import QtQuick
0009 import QtQuick.Layouts
0010 import QtQuick.Controls as QQC2
0011 import org.kde.kirigami 2.6 as Kirigami
0012 import org.kde.kcmutils as KCM
0013 import org.kde.kwin.kwinxwaylandsettings
0014 import org.kde.kquickcontrols
0015 
0016 KCM.SimpleKCM {
0017     id: root
0018     KCM.SettingStateBinding {
0019         configObject: kcm.settings
0020         settingName: "Xwayland"
0021     }
0022     implicitWidth: Kirigami.Units.gridUnit * 48
0023     implicitHeight: Kirigami.Units.gridUnit * 33
0024 
0025     QQC2.ButtonGroup {
0026         buttons: form.children
0027         exclusive: true
0028         checkedButton: buttons[kcm.settings.xwaylandEavesdrops]
0029         onCheckedButtonChanged: {
0030             let idx = -1
0031             for (const x in buttons) {
0032                 if (buttons[x] === checkedButton) {
0033                     idx = x
0034                 }
0035             }
0036             kcm.settings.xwaylandEavesdrops = idx
0037         }
0038     }
0039 
0040     ColumnLayout {
0041         id: column
0042         spacing: Kirigami.Units.smallSpacing
0043 
0044         QQC2.Label {
0045             Layout.fillWidth: true
0046             Layout.margins: Kirigami.Units.gridUnit
0047             text: i18n("Legacy X11 apps require the ability to read keystrokes typed in other apps for features that are activated using global keyboard shortcuts. This is disabled by default for security reasons. If you need to use such apps, you can choose your preferred balance of security and functionality here.")
0048             wrapMode: Text.Wrap
0049         }
0050 
0051         Kirigami.Separator {
0052             Layout.fillWidth: true
0053             Layout.leftMargin: Kirigami.Units.gridUnit
0054             Layout.rightMargin: Kirigami.Units.gridUnit
0055         }
0056 
0057         Kirigami.FormLayout {
0058             id: form
0059 
0060             Layout.leftMargin: Kirigami.Units.gridUnit
0061             Layout.rightMargin: Kirigami.Units.gridUnit
0062 
0063             QQC2.RadioButton {
0064                 Kirigami.FormData.label: i18n("Allow legacy X11 apps to read keystrokes typed in all apps:")
0065                 text: i18n("Never")
0066             }
0067             QQC2.RadioButton {
0068                 text: i18n("Only non-character keys")
0069             }
0070             QQC2.RadioButton {
0071                 text: i18n("As above, plus any key typed while the Control, Alt, or Meta keys are pressed")
0072             }
0073             QQC2.RadioButton {
0074                 id: always
0075                 text: i18n("Always")
0076             }
0077         }
0078 
0079         Kirigami.InlineMessage {
0080             Layout.fillWidth: true
0081             type: Kirigami.MessageType.Warning
0082             text: i18n("Note that using this setting will reduce system security to that of the X11 session by permitting malicious software to steal passwords and spy on the text that you type. Make sure you understand and accept this risk.")
0083             visible: always.checked
0084         }
0085     }
0086 }