Another possible hyprland active window fix

This commit is contained in:
Ly-sec 2025-08-19 23:18:28 +02:00
parent 8ffd2ab8ac
commit a9fceee62d
2 changed files with 61 additions and 14 deletions

View file

@ -29,18 +29,27 @@ Row {
Connections {
target: CompositorService
function onActiveWindowChanged() {
// Check if window actually changed
if (CompositorService.focusedWindowIndex !== lastWindowIndex) {
lastWindowIndex = CompositorService.focusedWindowIndex
showingFullTitle = true
fullTitleTimer.restart()
try {
// Check if window actually changed
if (CompositorService.focusedWindowIndex !== lastWindowIndex) {
lastWindowIndex = CompositorService.focusedWindowIndex
showingFullTitle = true
fullTitleTimer.restart()
}
} catch (e) {
console.error("ActiveWindow: Error in activeWindowChanged:", e)
}
}
}
function getTitle() {
const focusedWindow = CompositorService.getFocusedWindow()
return focusedWindow ? (focusedWindow.title || focusedWindow.appId || "") : ""
try {
const focusedWindow = CompositorService.getFocusedWindow()
return focusedWindow ? (focusedWindow.title || focusedWindow.appId || "") : ""
} catch (e) {
console.error("ActiveWindow: Error getting title:", e)
return ""
}
}
// A hidden text element to safely measure the full title width