diff --git a/Modals/WifiPasswordModal.qml b/Modals/WifiPasswordModal.qml index 7fa80e28..8b86b6d6 100644 --- a/Modals/WifiPasswordModal.qml +++ b/Modals/WifiPasswordModal.qml @@ -14,7 +14,7 @@ DankModal { visible: wifiPasswordModalVisible width: 420 height: 230 - keyboardFocus: "ondemand" + keyboardFocus: "exclusive" onVisibleChanged: { if (!visible) wifiPasswordInput = ""; @@ -39,8 +39,9 @@ DankModal { } content: Component { - Item { + FocusScope { anchors.fill: parent + focus: true Column { anchors.centerIn: parent @@ -102,8 +103,7 @@ DankModal { echoMode: showPasswordCheckbox.checked ? TextInput.Normal : TextInput.Password placeholderText: "Enter password" backgroundColor: "transparent" - normalBorderColor: "transparent" - focusedBorderColor: "transparent" + focus: true onTextEdited: { wifiPasswordInput = text; } @@ -114,13 +114,25 @@ DankModal { passwordInput.text = ""; } + Timer { + id: focusTimer + interval: 50 + onTriggered: passwordInput.forceActiveFocus() + } + + Component.onCompleted: { + focusTimer.start(); + } + Connections { function onOpened() { - passwordInput.forceActiveFocus(); + focusTimer.start(); } - function onDialogClosed() { - passwordInput.clearFocus(); + function onVisibleChanged() { + if (root.visible) { + focusTimer.start(); + } } target: root @@ -264,7 +276,6 @@ DankModal { } } - } } diff --git a/Modules/CentcomCenter/CentcomPopout.qml b/Modules/CentcomCenter/CentcomPopout.qml index 01e52628..354e135d 100644 --- a/Modules/CentcomCenter/CentcomPopout.qml +++ b/Modules/CentcomCenter/CentcomPopout.qml @@ -51,7 +51,7 @@ PanelWindow { implicitHeight: 600 WlrLayershell.layer: WlrLayershell.Overlay WlrLayershell.exclusiveZone: -1 - WlrLayershell.keyboardFocus: calendarVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None + WlrLayershell.keyboardFocus: calendarVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None color: "transparent" anchors { @@ -195,6 +195,9 @@ PanelWindow { if (event.key === Qt.Key_Escape) { calendarVisible = false; event.accepted = true; + } else { + // Don't handle other keys - let them bubble up to modals + event.accepted = false; } } diff --git a/Modules/ControlCenter/ControlCenterPopout.qml b/Modules/ControlCenter/ControlCenterPopout.qml index 18f0af51..d01eaee0 100644 --- a/Modules/ControlCenter/ControlCenterPopout.qml +++ b/Modules/ControlCenter/ControlCenterPopout.qml @@ -49,7 +49,7 @@ PanelWindow { implicitHeight: 500 WlrLayershell.layer: WlrLayershell.Overlay WlrLayershell.exclusiveZone: -1 - WlrLayershell.keyboardFocus: controlCenterVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None + WlrLayershell.keyboardFocus: controlCenterVisible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None color: "transparent" anchors { @@ -125,6 +125,8 @@ PanelWindow { if (event.key === Qt.Key_Escape) { controlCenterVisible = false; event.accepted = true; + } else { + event.accepted = false; } }