diff options
author | Karsten Schoelzel <kuser@gmx.de> | 2007-09-10 11:03:29 +0200 |
---|---|---|
committer | Karsten Schoelzel <kuser@gmx.de> | 2007-09-10 11:03:29 +0200 |
commit | 7f9e8fa6d9c36cf42430e5239fbdb8bcfdec3e00 (patch) | |
tree | f08c616430400f3d96aa120825da4e27eac8c004 /tests | |
parent | c8f468802e71ec61ea8c92e829a09a764355949f (diff) | |
download | metatile-7f9e8fa6d9c36cf42430e5239fbdb8bcfdec3e00.tar metatile-7f9e8fa6d9c36cf42430e5239fbdb8bcfdec3e00.zip |
Fix float behaviour, add shiftWin.
First, if float is called with window which is on a hidden workspace,
then the window will remain on that hidden workspace.
Now the focus should change more as expected:
float w = (view current) . (shiftWin ws w)
where
current is the current screen/workspace
shiftWin ws w is: - view the workspace w is on
- set focus on w
- shift ws
- set focus back to window it was on that workspace
unless w was focused
shiftWin was add to StackSet.hs
darcs-hash:20070910090329-eb3a1-ae150bf783b36fb4811e92d81b4917066c8733b7
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Properties.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs index e11b448..3207f95 100644 --- a/tests/Properties.hs +++ b/tests/Properties.hs @@ -167,6 +167,9 @@ prop_swap_right_I (n :: NonNegative Int) (x :: T) = prop_shift_I (n :: NonNegative Int) (x :: T) = n `tagMember` x ==> invariant $ shift (fromIntegral n) x +prop_shift_win_I (n :: NonNegative Int) (w :: Char) (x :: T) = + n `tagMember` x && w `member` x ==> invariant $ shiftWin (fromIntegral n) w x + -- --------------------------------------------------------------------- -- 'new' @@ -493,6 +496,23 @@ prop_shift_reversible i (x :: T) = y = swapMaster x n = tag (workspace $ current y) +-- --------------------------------------------------------------------- +-- shiftWin + +-- shiftWin on current window is the same as shift +prop_shift_win_focus i (x :: T) = + i `tagMember` x ==> case peek x of + Nothing -> True + Just w -> shiftWin i w x == shift i x + +-- shiftWin leaves the current screen as it is, if neither i is the tag +-- of the current workspace nor w on the current workspace +prop_shift_win_fix_current i w (x :: T) = + i `tagMember` x && w `member` x && i /= n && findIndex w x /= Just n + ==> (current $ x) == (current $ shiftWin i w x) + where + n = tag (workspace $ current x) + ------------------------------------------------------------------------ -- some properties for layouts: @@ -611,6 +631,9 @@ main = do ,("shift: invariant" , mytest prop_shift_I) ,("shift is reversible" , mytest prop_shift_reversible) + ,("shiftWin: invariant" , mytest prop_shift_win_I) + ,("shiftWin is shift on focus" , mytest prop_shift_win_focus) + ,("shiftWin fix current" , mytest prop_shift_win_fix_current) {- ,("tile 1 window fullsize", mytest prop_tile_fullscreen) |