From b340141c6a05604c18bdd229d8baf418d4ca22fb Mon Sep 17 00:00:00 2001 From: Wesley Kerfoot Date: Thu, 13 Aug 2020 11:05:13 -0400 Subject: [PATCH] make sure we're only restacking with windows we should manage --- src/nimwin.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nimwin.nim b/src/nimwin.nim index 9feef51..3f350df 100644 --- a/src/nimwin.nim +++ b/src/nimwin.nim @@ -576,7 +576,12 @@ when isMainModule: let currentFocus = windowZipper.zipperFocus if currentFocus.isSome: if currentFocus.get != ev.xfocus.window: - let windowStack = map(toSeq(getChildren(display)), (w) => w.win) + var windowStack : seq[TWindow] = @[] + + # Restack everything and make sure we should track it + for window in getChildren(display): + if display.shouldTrackWindow(window.win.addr): + windowStack &= window.win # restack it windowZipper.rhs = windowStack.reversed windowZipper.lhs = @[]