From 23db49d02774cfd08630644daeb03e77b7cdc5d3 Mon Sep 17 00:00:00 2001 From: leukipp Date: Wed, 2 Aug 2023 21:28:46 +0200 Subject: [PATCH] fix: store ordered client list --- store/manager.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/store/manager.go b/store/manager.go index 4526436..be3ca8b 100644 --- a/store/manager.go +++ b/store/manager.go @@ -3,7 +3,6 @@ package store import ( "math" - "github.com/BurntSushi/xgbutil/ewmh" "github.com/leukipp/cortile/common" log "github.com/sirupsen/logrus" @@ -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) @@ -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)))) }