Skip to content

Commit

Permalink
fix: store ordered client list
Browse files Browse the repository at this point in the history
  • Loading branch information
leukipp committed Aug 2, 2023
1 parent 22cfc8d commit 23db49d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions store/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package store
import (
"math"

"github.com/BurntSushi/xgbutil/ewmh"
"github.com/leukipp/cortile/common"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -285,8 +284,7 @@ func (mg *Manager) Ordered(windows *Clients) []*Client {
ordered := []*Client{}

// Create ordered client list
stacking, _ := ewmh.ClientListStackingGet(X)
for _, w := range stacking {
for _, w := range Windows {
for _, c := range windows.Items {
if w == c.Win.Id {
ordered = append(ordered, c)
Expand Down Expand Up @@ -317,12 +315,12 @@ func (mg *Manager) Clients(stacked bool) []*Client {
}

func (mg *Manager) updateMasters(cs []*Client) {
mg.Masters.Items = cs
mg.Masters.Items = mg.Ordered(&Clients{Items: cs})
mg.Proportions.MasterMaster = calcProportions(int(math.Min(float64(len(mg.Masters.Items)), float64(mg.Masters.MaxAllowed))))
}

func (mg *Manager) updateSlaves(cs []*Client) {
mg.Slaves.Items = cs
mg.Slaves.Items = mg.Ordered(&Clients{Items: cs})
mg.Proportions.SlaveSlave = calcProportions(int(math.Min(float64(len(mg.Slaves.Items)), float64(mg.Slaves.MaxAllowed))))
}

Expand Down

0 comments on commit 23db49d

Please sign in to comment.