mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Compositor: Fix Hyprland activeWindow icon
This commit is contained in:
@@ -166,10 +166,35 @@ Singleton {
|
||||
|
||||
for (var i = 0; i < hlToplevels.length; i++) {
|
||||
const toplevel = hlToplevels[i]
|
||||
|
||||
// Try to get appId from various sources
|
||||
let appId = ""
|
||||
|
||||
// First try the direct properties
|
||||
if (toplevel.class) {
|
||||
appId = toplevel.class
|
||||
} else if (toplevel.initialClass) {
|
||||
appId = toplevel.initialClass
|
||||
} else if (toplevel.appId) {
|
||||
appId = toplevel.appId
|
||||
}
|
||||
|
||||
// If still no appId, try to get it from the lastIpcObject
|
||||
if (!appId && toplevel.lastIpcObject) {
|
||||
try {
|
||||
const ipcData = toplevel.lastIpcObject
|
||||
// Try different possible property names for the application identifier
|
||||
appId = ipcData.class || ipcData.initialClass || ipcData.appId || ipcData.wm_class || ""
|
||||
} catch (e) {
|
||||
|
||||
// Ignore errors when accessing lastIpcObject
|
||||
}
|
||||
}
|
||||
|
||||
windowsList.push({
|
||||
"id": toplevel.address || "",
|
||||
"title": toplevel.title || "",
|
||||
"appId": toplevel.class || toplevel.initialClass || "",
|
||||
"appId": appId,
|
||||
"workspaceId": toplevel.workspace?.id || null,
|
||||
"isFocused": toplevel.activated === true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user