From 894f2ddf28e2540e62c529c9955660d131f47594 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Sat, 29 Sep 2007 01:28:39 +0200 Subject: polish darcs-hash:20070928232839-cba2c-133f82c6199a6b1a065b3a013d9c4f2b5e9a253c.gz --- StackSet.hs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'StackSet.hs') diff --git a/StackSet.hs b/StackSet.hs index 005669e..4660b80 100644 --- a/StackSet.hs +++ b/StackSet.hs @@ -33,7 +33,10 @@ module StackSet ( swapUp, swapDown, swapMaster, modify, modify', float, sink, -- needed by users -- * Composite operations -- $composite - shift, shiftWin + shift, shiftWin, + + -- for testing + abort ) where import Prelude hiding (filter) @@ -232,19 +235,20 @@ view i s | Just x <- L.find ((i==).tag.workspace) (visible s) -- if it is visible, it is just raised - = s { current = x, visible = current s : L.deleteBy screenEq x (visible s) } + = s { current = x, visible = current s : L.deleteBy (equating screen) x (visible s) } | Just x <- L.find ((i==).tag) (hidden s) -- if it was hidden, it is raised on the xine screen currently used = s { current = (current s) { workspace = x } - , hidden = workspace (current s) : L.deleteBy tagEq x (hidden s) } + , hidden = workspace (current s) : L.deleteBy (equating tag) x (hidden s) } - | otherwise = s - where screenEq x y = screen x == screen y - tagEq x y = tag x == tag y + | otherwise = s -- can't happen? + where equating f = \x y -> f x == f y -- 'Catch'ing this might be hard. Relies on monotonically increasing -- workspace tags defined in 'new' + -- + -- and now tags are not monotonic, what happens here? -- | -- Set focus to the given workspace. If that workspace does not exist -- cgit v1.2.3