1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-28 23:42:51 -05:00

niri: keep overview focus when open

This commit is contained in:
bbedward
2025-11-26 09:38:15 -05:00
parent e5a6a00282
commit 1f2a1c5dec

View File

@@ -12,10 +12,12 @@ Scope {
property bool searchActive: false property bool searchActive: false
property string searchActiveScreen: "" property string searchActiveScreen: ""
property bool isClosing: false property bool isClosing: false
property bool releaseKeyboard: false
property bool overlayActive: (NiriService.inOverview && !(PopoutService.spotlightModal?.spotlightOpen ?? false)) || searchActive property bool overlayActive: (NiriService.inOverview && !(PopoutService.spotlightModal?.spotlightOpen ?? false)) || searchActive
function showSpotlight(screenName) { function showSpotlight(screenName) {
isClosing = false; isClosing = false;
releaseKeyboard = false;
searchActive = true; searchActive = true;
searchActiveScreen = screenName; searchActiveScreen = screenName;
} }
@@ -26,10 +28,16 @@ Scope {
isClosing = true; isClosing = true;
} }
function hideAndReleaseKeyboard() {
releaseKeyboard = true;
hideSpotlight();
}
function completeHide() { function completeHide() {
searchActive = false; searchActive = false;
searchActiveScreen = ""; searchActiveScreen = "";
isClosing = false; isClosing = false;
releaseKeyboard = false;
} }
Connections { Connections {
@@ -97,7 +105,7 @@ Scope {
return WlrKeyboardFocus.None; return WlrKeyboardFocus.None;
if (!isActiveScreen) if (!isActiveScreen)
return WlrKeyboardFocus.None; return WlrKeyboardFocus.None;
if (niriOverviewScope.isClosing) if (niriOverviewScope.releaseKeyboard)
return WlrKeyboardFocus.None; return WlrKeyboardFocus.None;
return WlrKeyboardFocus.Exclusive; return WlrKeyboardFocus.Exclusive;
} }
@@ -248,6 +256,20 @@ Scope {
Component.onCompleted: { Component.onCompleted: {
parentModal = fakeParentModal; parentModal = fakeParentModal;
} }
Connections {
target: spotlightContent.appLauncher
function onAppLaunched() {
niriOverviewScope.releaseKeyboard = true;
}
}
Connections {
target: spotlightContent.fileSearchController
function onFileOpened() {
niriOverviewScope.releaseKeyboard = true;
}
}
} }
} }
} }