Combine windows of one program into a counted icon, auto-hide, links open in default browser
This commit is contained in:
@@ -257,8 +257,12 @@ func refreshApps(refreshIcons bool) bool {
|
||||
}
|
||||
}
|
||||
|
||||
present0 := make(map[uintptr]appWin, len(present))
|
||||
for h, w := range present {
|
||||
present0[h] = w
|
||||
}
|
||||
var next []appWin
|
||||
for _, a := range apps {
|
||||
for _, a := range allApps {
|
||||
if a.hwnd == 0 {
|
||||
next = append(next, a) // a waiting launcher; sorted out below
|
||||
continue
|
||||
@@ -321,13 +325,17 @@ func refreshApps(refreshIcons bool) bool {
|
||||
}
|
||||
}
|
||||
|
||||
noteForeground(present0)
|
||||
allApps = next
|
||||
grouped := groupApps(next)
|
||||
|
||||
// Titles change constantly (browser tabs, documents) but nothing on the
|
||||
// bar shows them, so only a change in which buttons exist, or their icons,
|
||||
// counts as a change.
|
||||
changed := len(next) != len(apps)
|
||||
// bar shows them, so only a change in which buttons exist, their icons, or
|
||||
// how many windows an icon stands for counts as a change.
|
||||
changed := len(grouped) != len(apps)
|
||||
if !changed {
|
||||
for i := range next {
|
||||
if next[i].hwnd != apps[i].hwnd || next[i].icon != apps[i].icon {
|
||||
for i := range grouped {
|
||||
if grouped[i].hwnd != apps[i].hwnd || grouped[i].icon != apps[i].icon || grouped[i].count != apps[i].count {
|
||||
changed = true
|
||||
break
|
||||
}
|
||||
@@ -336,7 +344,7 @@ func refreshApps(refreshIcons bool) bool {
|
||||
if changed {
|
||||
styleCacheClear() // icon handles can be reused by other icons
|
||||
}
|
||||
apps = next
|
||||
apps = grouped
|
||||
return changed
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user