mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
extws: fix capability check & don't show names
This commit is contained in:
@@ -316,12 +316,19 @@ Item {
|
||||
return [{"id": "1", "name": "1", "active": false}]
|
||||
}
|
||||
|
||||
const visible = group.workspaces.filter(ws => !ws.hidden).sort((a, b) => {
|
||||
const coordsA = a.coordinates || [0, 0]
|
||||
const coordsB = b.coordinates || [0, 0]
|
||||
if (coordsA[0] !== coordsB[0]) return coordsA[0] - coordsB[0]
|
||||
return coordsA[1] - coordsB[1]
|
||||
}).map(ws => ({
|
||||
let visible = group.workspaces.filter(ws => !ws.hidden)
|
||||
|
||||
const hasValidCoordinates = visible.some(ws => ws.coordinates && ws.coordinates.length > 0)
|
||||
if (hasValidCoordinates) {
|
||||
visible = visible.sort((a, b) => {
|
||||
const coordsA = a.coordinates || [0, 0]
|
||||
const coordsB = b.coordinates || [0, 0]
|
||||
if (coordsA[0] !== coordsB[0]) return coordsA[0] - coordsB[0]
|
||||
return coordsA[1] - coordsB[1]
|
||||
})
|
||||
}
|
||||
|
||||
visible = visible.map(ws => ({
|
||||
id: ws.id,
|
||||
name: ws.name,
|
||||
coordinates: ws.coordinates,
|
||||
@@ -350,7 +357,7 @@ Item {
|
||||
|
||||
function getRealWorkspaces() {
|
||||
return root.workspaceList.filter(ws => {
|
||||
if (useExtWorkspace) return ws && ws.id !== "" && !ws.hidden
|
||||
if (useExtWorkspace) return ws && (ws.id !== "" || ws.name !== "") && !ws.hidden
|
||||
if (CompositorService.isHyprland) return ws && ws.id !== -1
|
||||
if (CompositorService.isDwl) return ws && ws.tag !== -1
|
||||
if (CompositorService.isSway) return ws && ws.num !== -1
|
||||
@@ -893,7 +900,7 @@ Item {
|
||||
|
||||
if (isPlaceholder) return index + 1
|
||||
|
||||
if (root.useExtWorkspace) return modelData?.name || modelData?.id || ""
|
||||
if (root.useExtWorkspace) return index + 1
|
||||
if (CompositorService.isHyprland) return modelData?.id || ""
|
||||
if (CompositorService.isDwl) return (modelData?.tag !== undefined) ? (modelData.tag + 1) : ""
|
||||
if (CompositorService.isSway) return modelData?.num || ""
|
||||
|
||||
@@ -46,8 +46,17 @@ Singleton {
|
||||
|
||||
const hasExtWorkspace = DMSService.capabilities.includes("extworkspace")
|
||||
if (hasExtWorkspace && !extWorkspaceAvailable) {
|
||||
if (typeof CompositorService !== "undefined") {
|
||||
const useExtWorkspace = !CompositorService.isNiri && !CompositorService.isHyprland && !CompositorService.isDwl && !CompositorService.isSway
|
||||
if (!useExtWorkspace) {
|
||||
console.info("ExtWorkspaceService: ext-workspace available but compositor has native support")
|
||||
extWorkspaceAvailable = false
|
||||
return
|
||||
}
|
||||
}
|
||||
extWorkspaceAvailable = true
|
||||
console.info("ExtWorkspaceService: ext-workspace capability detected")
|
||||
DMSService.addSubscription("extworkspace")
|
||||
requestState()
|
||||
} else if (!hasExtWorkspace) {
|
||||
extWorkspaceAvailable = false
|
||||
@@ -181,12 +190,17 @@ Singleton {
|
||||
|
||||
function getVisibleWorkspaces(outputName) {
|
||||
const workspaces = getWorkspacesForOutput(outputName)
|
||||
const visible = workspaces.filter(ws => !ws.hidden).sort((a, b) => {
|
||||
const coordsA = a.coordinates || [0, 0]
|
||||
const coordsB = b.coordinates || [0, 0]
|
||||
if (coordsA[0] !== coordsB[0]) return coordsA[0] - coordsB[0]
|
||||
return coordsA[1] - coordsB[1]
|
||||
})
|
||||
let visible = workspaces.filter(ws => !ws.hidden)
|
||||
|
||||
const hasValidCoordinates = visible.some(ws => ws.coordinates && ws.coordinates.length > 0)
|
||||
if (hasValidCoordinates) {
|
||||
visible = visible.sort((a, b) => {
|
||||
const coordsA = a.coordinates || [0, 0]
|
||||
const coordsB = b.coordinates || [0, 0]
|
||||
if (coordsA[0] !== coordsB[0]) return coordsA[0] - coordsB[0]
|
||||
return coordsA[1] - coordsB[1]
|
||||
})
|
||||
}
|
||||
|
||||
const cacheKey = outputName
|
||||
if (!_cachedWorkspaces[cacheKey]) {
|
||||
|
||||
Reference in New Issue
Block a user