Small change to ActiveWindow
This commit is contained in:
parent
374d3681ce
commit
e04c4e1394
2 changed files with 8 additions and 13 deletions
|
|
@ -27,7 +27,7 @@ Row {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update text when window changes or title changes
|
// Update text when window changes
|
||||||
Connections {
|
Connections {
|
||||||
target: CompositorService
|
target: CompositorService
|
||||||
function onActiveWindowChanged() {
|
function onActiveWindowChanged() {
|
||||||
|
|
@ -38,15 +38,6 @@ Row {
|
||||||
fullTitleTimer.restart()
|
fullTitleTimer.restart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWindowTitleChanged() {
|
|
||||||
// Direct response to title changes
|
|
||||||
if (CompositorService.focusedWindowIndex === lastWindowIndex) {
|
|
||||||
// Same window, title changed - show full title briefly
|
|
||||||
showingFullTitle = true
|
|
||||||
fullTitleTimer.restart()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTitle() {
|
function getTitle() {
|
||||||
|
|
|
||||||
|
|
@ -311,14 +311,18 @@ Singleton {
|
||||||
|
|
||||||
// Update focused window index if this window is focused
|
// Update focused window index if this window is focused
|
||||||
if (newWindow.isFocused) {
|
if (newWindow.isFocused) {
|
||||||
|
const oldFocusedIndex = focusedWindowIndex
|
||||||
focusedWindowIndex = windows.findIndex(w => w.id === windowData.id)
|
focusedWindowIndex = windows.findIndex(w => w.id === windowData.id)
|
||||||
updateFocusedWindowTitle()
|
updateFocusedWindowTitle()
|
||||||
activeWindowChanged()
|
|
||||||
|
// Only emit activeWindowChanged if the focused window actually changed
|
||||||
|
if (oldFocusedIndex !== focusedWindowIndex) {
|
||||||
|
activeWindowChanged()
|
||||||
|
}
|
||||||
} else if (existingIndex >= 0 && existingIndex === focusedWindowIndex) {
|
} else if (existingIndex >= 0 && existingIndex === focusedWindowIndex) {
|
||||||
// If this is the currently focused window (but not newly focused),
|
// If this is the currently focused window (but not newly focused),
|
||||||
// still update the title in case it changed
|
// still update the title in case it changed, but don't emit activeWindowChanged
|
||||||
updateFocusedWindowTitle()
|
updateFocusedWindowTitle()
|
||||||
activeWindowChanged()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
windowListChanged()
|
windowListChanged()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue