mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-02 02:22:06 -04:00
Compare commits
2 Commits
7a3444bd30
...
6b15670918
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b15670918 | ||
|
|
c52b9e19a1 |
10
flake.lock
generated
10
flake.lock
generated
@@ -23,16 +23,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766725085,
|
"lastModified": 1776854048,
|
||||||
"narHash": "sha256-O2aMFdDUYJazFrlwL7aSIHbUSEm3ADVZjmf41uBJfHs=",
|
"narHash": "sha256-lLbV66V3RMNp1l8/UelmR4YzoJ5ONtgvEtiUMJATH/o=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff",
|
"rev": "783c953987dc56ff0601abe6845ed96f1d00495a",
|
||||||
"revCount": 715,
|
"revCount": 806,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff",
|
"rev": "783c953987dc56ff0601abe6845ed96f1d00495a",
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
quickshell = {
|
quickshell = {
|
||||||
url = "git+https://git.outfoxxed.me/quickshell/quickshell?rev=41828c4180fb921df7992a5405f5ff05d2ac2fff";
|
url = "git+https://git.outfoxxed.me/quickshell/quickshell?rev=783c953987dc56ff0601abe6845ed96f1d00495a";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -42,19 +42,26 @@ BasePill {
|
|||||||
const active = ToplevelManager.activeToplevel;
|
const active = ToplevelManager.activeToplevel;
|
||||||
|
|
||||||
if (!active) {
|
if (!active) {
|
||||||
// Only clear if our tracked window is no longer alive
|
|
||||||
if (activeWindow) {
|
if (activeWindow) {
|
||||||
|
if (CompositorService.isNiri) {
|
||||||
|
if (NiriService.currentOutput === (parentScreen?.name ?? ""))
|
||||||
|
activeWindow = null;
|
||||||
|
} else {
|
||||||
const alive = ToplevelManager.toplevels?.values;
|
const alive = ToplevelManager.toplevels?.values;
|
||||||
if (alive && !Array.from(alive).some(t => t === activeWindow))
|
if (alive && !Array.from(alive).some(t => t === activeWindow))
|
||||||
activeWindow = null;
|
activeWindow = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!parentScreen || CompositorService.filterCurrentDisplay([active], parentScreen?.name)?.length > 0) {
|
if (!parentScreen || CompositorService.filterCurrentDisplay([active], parentScreen?.name)?.length > 0) {
|
||||||
activeWindow = active;
|
activeWindow = active;
|
||||||
|
} else if (activeWindow) {
|
||||||
|
const alive = ToplevelManager.toplevels?.values;
|
||||||
|
if (alive && !Array.from(alive).some(t => t === activeWindow))
|
||||||
|
activeWindow = null;
|
||||||
}
|
}
|
||||||
// else: active window is on a different screen so keep the previous value
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
@@ -65,6 +72,7 @@ BasePill {
|
|||||||
Connections {
|
Connections {
|
||||||
target: ToplevelManager
|
target: ToplevelManager
|
||||||
function onActiveToplevelChanged() {
|
function onActiveToplevelChanged() {
|
||||||
|
if (!CompositorService.isNiri)
|
||||||
root.updateActiveWindow();
|
root.updateActiveWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,6 +84,16 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: CompositorService.isNiri ? NiriService : null
|
||||||
|
function onWindowsChanged() {
|
||||||
|
root.updateActiveWindow();
|
||||||
|
}
|
||||||
|
function onCurrentOutputChanged() {
|
||||||
|
root.updateActiveWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: DesktopEntries
|
target: DesktopEntries
|
||||||
function onApplicationsChanged() {
|
function onApplicationsChanged() {
|
||||||
@@ -107,21 +125,17 @@ BasePill {
|
|||||||
}
|
}
|
||||||
readonly property bool hasWindowsOnCurrentWorkspace: {
|
readonly property bool hasWindowsOnCurrentWorkspace: {
|
||||||
if (CompositorService.isNiri) {
|
if (CompositorService.isNiri) {
|
||||||
let currentWorkspaceId = null;
|
if (!activeWindow || !(activeWindow.title || activeWindow.appId))
|
||||||
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
|
|
||||||
const ws = NiriService.allWorkspaces[i];
|
|
||||||
if (ws.is_focused) {
|
|
||||||
currentWorkspaceId = ws.id;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!currentWorkspaceId) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
if (NiriService.currentOutput !== (parentScreen?.name ?? ""))
|
||||||
|
return true;
|
||||||
const workspaceWindows = NiriService.windows.filter(w => w.workspace_id === currentWorkspaceId);
|
const focusedWin = NiriService.windows.find(w => w.is_focused);
|
||||||
return workspaceWindows.length > 0 && activeWindow && (activeWindow.title || activeWindow.appId);
|
if (!focusedWin)
|
||||||
|
return false;
|
||||||
|
const screenWsIds = new Set(
|
||||||
|
NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id)
|
||||||
|
);
|
||||||
|
return screenWsIds.has(focusedWin.workspace_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CompositorService.isHyprland) {
|
if (CompositorService.isHyprland) {
|
||||||
|
|||||||
@@ -371,8 +371,21 @@ Singleton {
|
|||||||
function filterCurrentDisplay(toplevels, screenName) {
|
function filterCurrentDisplay(toplevels, screenName) {
|
||||||
if (!toplevels || toplevels.length === 0 || !screenName)
|
if (!toplevels || toplevels.length === 0 || !screenName)
|
||||||
return toplevels;
|
return toplevels;
|
||||||
if (useNiriSorting)
|
if (useNiriSorting) {
|
||||||
|
const active = ToplevelManager.activeToplevel;
|
||||||
|
if (active && toplevels.length === 1 && toplevels[0] === active) {
|
||||||
|
if (NiriService.currentOutput !== screenName)
|
||||||
|
return [];
|
||||||
|
const focusedWin = NiriService.windows.find(nw => nw.is_focused);
|
||||||
|
if (!focusedWin)
|
||||||
|
return [];
|
||||||
|
const screenWsIds = new Set(
|
||||||
|
NiriService.allWorkspaces.filter(ws => ws.output === screenName).map(ws => ws.id)
|
||||||
|
);
|
||||||
|
return screenWsIds.has(focusedWin.workspace_id) ? toplevels : [];
|
||||||
|
}
|
||||||
return NiriService.filterCurrentDisplay(toplevels, screenName);
|
return NiriService.filterCurrentDisplay(toplevels, screenName);
|
||||||
|
}
|
||||||
if (isHyprland)
|
if (isHyprland)
|
||||||
return filterHyprlandCurrentDisplaySafe(toplevels, screenName);
|
return filterHyprlandCurrentDisplaySafe(toplevels, screenName);
|
||||||
return toplevels;
|
return toplevels;
|
||||||
|
|||||||
Reference in New Issue
Block a user