mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Compositor: fix getFocusedWindowTitle. Since active workspace has been implemented.
+ autoformatting
This commit is contained in:
+10
-10
@@ -101,7 +101,7 @@ Item {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
windowsList.push({
|
||||
"id": win.id,
|
||||
"title": win.title || "",
|
||||
@@ -170,7 +170,7 @@ Item {
|
||||
try {
|
||||
const windowData = eventData.window
|
||||
const existingIndex = windows.findIndex(w => w.id === windowData.id)
|
||||
|
||||
|
||||
var output = null
|
||||
for (var i = 0; i < workspaces.count; i++) {
|
||||
if (workspaces.get(i).id === windowData.workspace_id) {
|
||||
@@ -251,17 +251,17 @@ Item {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
windowsList.push({
|
||||
"id": win.id,
|
||||
"title": win.title || "",
|
||||
"appId": win.app_id || "",
|
||||
"workspaceId": win.workspace_id || null,
|
||||
"isFocused": win.is_focused === true,
|
||||
"output": output,
|
||||
"output": output
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
windowsList.sort((a, b) => a.id - b.id)
|
||||
windows = windowsList
|
||||
windowListChanged()
|
||||
@@ -284,18 +284,18 @@ Item {
|
||||
function handleWindowFocusChanged(eventData) {
|
||||
try {
|
||||
const focusedId = eventData.id
|
||||
|
||||
|
||||
if (windows[focusedWindowIndex]) {
|
||||
windows[focusedWindowIndex].isFocused = false
|
||||
}
|
||||
|
||||
if (focusedId) {
|
||||
const newIndex = windows.findIndex(w => w.id === focusedId)
|
||||
|
||||
|
||||
if (newIndex >= 0) {
|
||||
windows[newIndex].isFocused = true
|
||||
}
|
||||
|
||||
|
||||
focusedWindowIndex = newIndex >= 0 ? newIndex : -1
|
||||
} else {
|
||||
focusedWindowIndex = -1
|
||||
@@ -315,7 +315,7 @@ Item {
|
||||
Logger.error("NiriService", "Failed to switch workspace:", e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function focusWindow(windowId) {
|
||||
try {
|
||||
Quickshell.execDetached(["niri", "msg", "action", "focus-window", "--id", windowId.toString()])
|
||||
@@ -323,7 +323,7 @@ Item {
|
||||
Logger.error("NiriService", "Failed to switch window:", e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function closeWindow(windowId) {
|
||||
try {
|
||||
Quickshell.execDetached(["niri", "msg", "action", "close-window", "--id", windowId.toString()])
|
||||
|
||||
Reference in New Issue
Block a user