Hyprland: fix app title

This commit is contained in:
ItsLemmy
2025-10-16 20:07:23 -04:00
parent 65450fa156
commit 0e620a6836
2 changed files with 17 additions and 7 deletions
+15 -4
View File
@@ -242,8 +242,8 @@ Item {
if (!windowId)
return null
const appId = extractAppId(toplevel)
const title = safeGetProperty(toplevel, "title", "")
const appId = getAppId(toplevel)
const title = getAppTitle(toplevel)
const wsId = toplevel.workspace ? toplevel.workspace.id : null
const focused = toplevel.activated === true
const output = toplevel.monitor?.name || ""
@@ -261,8 +261,19 @@ Item {
}
}
// Extract app ID from various possible sources
function extractAppId(toplevel) {
function getAppTitle(toplevel) {
try {
var title = toplevel.wayland.title
if (title)
return title
} catch (e) {
}
return safeGetProperty(toplevel, "title", "")
}
function getAppId(toplevel) {
if (!toplevel)
return ""
+2 -3
View File
@@ -198,7 +198,7 @@ Item {
try {
// Safely extract properties
const appId = extractAppId(toplevel)
const appId = getAppId(toplevel)
const title = safeGetProperty(toplevel, "title", "")
const focused = toplevel.activated === true
@@ -213,8 +213,7 @@ Item {
}
}
// Extract app ID from various possible sources
function extractAppId(toplevel) {
function getAppId(toplevel) {
if (!toplevel)
return ""