diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 5ad8f6e2..3458032e 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -674,7 +674,7 @@ Singleton { // Read raw JSON file to access properties not in adapter schema try { var rawJson = settingsFileView.text() - + if (rawJson) { var parsed = JSON.parse(rawJson) if (parsed.appLauncher && parsed.appLauncher.backgroundOpacity !== undefined) { diff --git a/Modules/MainScreen/SmartPanel.qml b/Modules/MainScreen/SmartPanel.qml index a9a335ca..5a5f25c6 100644 --- a/Modules/MainScreen/SmartPanel.qml +++ b/Modules/MainScreen/SmartPanel.qml @@ -28,8 +28,6 @@ Item { property real preferredHeight: 900 property real preferredWidthRatio property real preferredHeightRatio - property color panelBackgroundColor: Color.mSurface - property color panelBorderColor: Color.mOutline property var buttonItem: null property bool forceAttachToBar: false @@ -41,6 +39,9 @@ Item { property bool panelAnchorLeft: false property bool panelAnchorRight: false + // Keyboard focus + property bool exclusiveKeyboard: true + // Track if window has been created (for lazy loading) property bool windowCreated: false @@ -190,8 +191,7 @@ Item { placeholder: panelPlaceholder panelContent: root.panelContent panelWrapper: root // Pass reference to SmartPanel for keyboard handlers - panelBackgroundColor: root.panelBackgroundColor - panelBorderColor: root.panelBorderColor + exclusiveKeyboard: root.exclusiveKeyboard // Forward signals onPanelOpened: root.opened() diff --git a/Modules/MainScreen/SmartPanelWindow.qml b/Modules/MainScreen/SmartPanelWindow.qml index bea07ef9..64c9d44f 100644 --- a/Modules/MainScreen/SmartPanelWindow.qml +++ b/Modules/MainScreen/SmartPanelWindow.qml @@ -24,9 +24,8 @@ PanelWindow { // Reference to the SmartPanel wrapper (for keyboard handlers) property var panelWrapper: null - // Color properties (forwarded from SmartPanel) - property color panelBackgroundColor: Color.mSurface - property color panelBorderColor: Color.mOutline + // Keyboard focus + property bool exclusiveKeyboard: true // Track whether panel is open property bool isPanelOpen: false @@ -129,17 +128,7 @@ PanelWindow { WlrLayershell.layer: WlrLayer.Top WlrLayershell.namespace: "noctalia-panel-content-" + placeholder.panelName + "-" + (placeholder.screen?.name || "unknown") WlrLayershell.exclusionMode: ExclusionMode.Ignore - - // Different compositor handle the keyboard focus differently (inc. mouse) - // This ensures all keyboard shortcuts work reliably (Escape, etc.) - // Also ensures that the launcher get proper focus on launch. - WlrLayershell.keyboardFocus: { - if (CompositorService.isNiri) { - return root.isPanelOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None - } else { - return root.isPanelOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None - } - } + WlrLayershell.keyboardFocus: !root.isPanelOpen ? WlrKeyboardFocus.None : (exclusiveKeyboard ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.OnDemand) // Anchor to all edges to make fullscreen anchors { diff --git a/Modules/Panels/Launcher/Launcher.qml b/Modules/Panels/Launcher/Launcher.qml index fb2851e5..3faf2bb3 100644 --- a/Modules/Panels/Launcher/Launcher.qml +++ b/Modules/Panels/Launcher/Launcher.qml @@ -19,8 +19,6 @@ SmartPanel { preferredWidthRatio: 0.3 preferredHeightRatio: 0.5 - exclusiveKeyboard: true - // Positioning readonly property string panelPosition: { if (Settings.data.appLauncher.position === "follow_bar") { diff --git a/Modules/Panels/Tray/TrayDrawerPanel.qml b/Modules/Panels/Tray/TrayDrawerPanel.qml index ffc9bb8d..bbe02ded 100644 --- a/Modules/Panels/Tray/TrayDrawerPanel.qml +++ b/Modules/Panels/Tray/TrayDrawerPanel.qml @@ -12,6 +12,9 @@ import qs.Modules.MainScreen SmartPanel { id: root + // Do not give exclusive focus to the TrayDrawer or it will prevent the dropdown menu to request it. + exclusiveKeyboard: false + // Widget info for menu functionality property string widgetSection: "" property int widgetIndex: -1