Diagnostics collects what this session doesn't allow, logs it, and lists it in the settings panel (with a dot on the gear): KWin not launching sloposk as its keyboard (detected by WAYLAND_SOCKET, since KWin offers the input-method global to every client), fake input missing or too old, org.kde.keyboard unreachable, and the D-Bus control name taken. Modifier combos go through fake input even in text fields: KWin drops the input method's modifier mask for most clients, so Ctrl+A typed "a". The desktop file is generated with an absolute Exec, which KWin needs to match it: one for the installed binary, one for the build's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
84 lines
3.0 KiB
QML
84 lines
3.0 KiB
QML
import QtQuick
|
|
import Sloposk
|
|
|
|
Window {
|
|
id: root
|
|
|
|
required property LayoutModel layoutModel
|
|
required property KeyboardController controller
|
|
required property Settings settings
|
|
required property Diagnostics diagnostics
|
|
property var placement: null // FloatingWindow, set from C++
|
|
property bool settingsOpen: false
|
|
// Height of the key area, for C++ keeping key sizes when rows change.
|
|
readonly property real keysHeight: keyboard.height
|
|
|
|
// Transparent room above the keyboard for long-press popups on the top row.
|
|
readonly property real popupMargin: 90
|
|
// Outside this, input passes through to whatever is below the window.
|
|
readonly property rect inputRegion: keyboard.alternates.open
|
|
? Qt.rect(0, 0, width, height)
|
|
: Qt.rect(panel.x, panel.y, panel.width, panel.height)
|
|
// Empty when nothing shows through, so the compositor skips the blur.
|
|
readonly property rect blurRegion: settings.blurBackground && settings.backgroundOpacity < 1
|
|
? Qt.rect(panel.x, panel.y, panel.width, panel.height)
|
|
: Qt.rect(0, 0, 0, 0)
|
|
|
|
width: 1000
|
|
height: 340 + popupMargin
|
|
minimumWidth: 480
|
|
minimumHeight: 180 + popupMargin
|
|
visible: false
|
|
color: "transparent"
|
|
|
|
onInputRegionChanged: placement?.setInputRegion(inputRegion)
|
|
onBlurRegionChanged: placement?.setBlurRegion(blurRegion, Theme.windowRadius)
|
|
onPlacementChanged: {
|
|
placement?.setInputRegion(inputRegion);
|
|
placement?.setBlurRegion(blurRegion, Theme.windowRadius);
|
|
}
|
|
|
|
Rectangle {
|
|
id: panel
|
|
anchors { fill: parent; topMargin: root.popupMargin }
|
|
radius: Theme.windowRadius
|
|
color: Qt.rgba(Theme.background.r, Theme.background.g, Theme.background.b, root.settings.backgroundOpacity)
|
|
|
|
Keyboard {
|
|
id: keyboard
|
|
anchors { left: parent.left; right: parent.right; top: parent.top; bottom: handle.top }
|
|
anchors.margins: 2
|
|
visible: !root.settingsOpen
|
|
model: root.layoutModel
|
|
controller: root.controller
|
|
popupHeadroom: root.popupMargin + anchors.margins
|
|
}
|
|
|
|
SettingsPanel {
|
|
anchors.fill: keyboard
|
|
visible: root.settingsOpen
|
|
settings: root.settings
|
|
layoutModel: root.layoutModel
|
|
diagnostics: root.diagnostics
|
|
}
|
|
|
|
DragHandle {
|
|
id: handle
|
|
anchors { left: parent.left; right: parent.right; bottom: parent.bottom }
|
|
onDragStarted: root.startSystemMove()
|
|
}
|
|
|
|
SettingsButton {
|
|
anchors { left: parent.left; leftMargin: 8; bottom: parent.bottom }
|
|
checked: root.settingsOpen
|
|
alert: root.diagnostics.problems.length > 0
|
|
onClicked: root.settingsOpen = !root.settingsOpen
|
|
}
|
|
|
|
ResizeHandle {
|
|
anchors { right: parent.right; bottom: parent.bottom }
|
|
onDragStarted: root.startSystemResize(Qt.RightEdge | Qt.BottomEdge)
|
|
}
|
|
}
|
|
}
|