Commit Graph

52 Commits

Author SHA1 Message Date
Don Stewart
60f4f4e5e4 HEADS UP: change key binding for swapLeft/Right and IncMaster
The use of arrow keys for swapLeft/Right clash with firefox's back
button. Use the more intuitive mod-shift-jk for this. (It's a movement
operation, after all).

This clashes with IncMaster, so we use mod+comma and mod+period for
these (i.e. the keys mod < and mod > , to move windows to and from the
master area).

While we're here, replace the use of the terms 'left' and 'right' for
navigation, in comments and identifiers, with 'up' and 'down' instead.
Hence mod-j == focusDown. Far more intuitive for people (dons) who live
in fullscreen mode and have vim movement wired into their central
nervous system.

Principle of least VI surprise: movement down or up means using j and k.
2007-05-26 11:14:53 +00:00
Neil Mitchell
6f9998ad27 Delete the Catch wrapper, no longer required by the latest version of Catch 2007-05-23 23:29:41 +00:00
glasser
52608185b4 Add a test that the size field of StackSet is correct to QuickCheck invariant. 2007-05-25 16:31:59 +00:00
Rob
7afc18b0e1 Quickcheck property to check that delete / focus behaviour
See patch "Deleting a window should not affect focus". Checks this property.
2007-05-25 03:54:32 +00:00
Rob
a36bd31973 Fix bug in noDuplicate invariant
ws used by noDuplicates is actually a list of list of elements which 
will pretty rarely raise any flags even if the StackSet actually does
contain duplicates. This patch concatenates ws to ensure the quickcheck
property tests accurately.
2007-05-25 06:08:42 +00:00
bobstopper
bcf305cd1e add swapLeft and swapRight 2007-05-22 05:00:08 +00:00
Neil Mitchell
c4dd126200 Update the Catch checking to the new interface for StackSet 2007-05-22 01:54:22 +00:00
Don Stewart
ea80d2a71f Move xinerama current/visible/hidden workspace logic into StackSet directly. 2007-05-21 05:52:53 +00:00
Don Stewart
77e46027ed HEADS UP: Rewrite StackSet as a Zipper
In order to give a better account of how focus and master interact, and
how each operation affects focus, we reimplement the StackSet type as a
two level nested 'Zipper'. To quote Oleg:

    A Zipper is essentially an `updateable' and yet pure functional
    cursor into a data structure. Zipper is also a delimited
    continuation reified as a data structure.

That is, we use the Zipper as a cursor which encodes the window which is
in focus. Thus our data structure tracks focus correctly by
construction! We then get simple, obvious semantics for e.g. insert, in
terms of how it affects focus/master. Our transient-messes-with-focus
bug evaporates. 'swap' becomes trivial.

By moving focus directly into the stackset, we can toss some QC
properties about focus handling: it is simply impossible now for focus
to go wrong. As a benefit, we get a dozen new QC properties for free,
governing how master and focus operate.

The encoding of focus in the data type also simplifies the focus
handling in Operations: several operations affecting focus are now
simply wrappers over StackSet.

For the full story, please read the StackSet module, and the QC
properties.

Finally, we save ~40 lines with the simplified logic in Operations.hs

For more info, see the blog post on the implementation,

    http://cgi.cse.unsw.edu.au/~dons/blog/2007/05/17#xmonad_part1b_zipper
2007-05-20 07:00:53 +00:00
Jason Creighton
4206c4bae9 variable number of windows in master area 2007-05-16 03:14:37 +00:00
David Roundy
3cc55de0f4 beautify tile 2007-05-15 15:40:11 +00:00
David Roundy
54ee507cca keep focus stack. 2007-05-10 13:16:37 +00:00
Jason Creighton
378aa87173 bump LOC limit to 550 2007-05-10 03:27:31 +00:00
Spencer Janssen
47ae5e4ea5 Remove broken prop_promoterotate, replace it with prop_promote_raise_id 2007-05-08 21:19:07 +00:00
Spencer Janssen
c4030d45e2 Disable shift_reversible until focus issues are decided. 2007-05-08 21:09:52 +00:00
Spencer Janssen
f5b0df6a73 Disable delete.push until focus issues are decided 2007-05-08 20:49:21 +00:00
Neil Mitchell
626d25bb3a Add the initial Catch testing framework for StackSet 2007-05-08 15:46:21 +00:00
Spencer Janssen
4afb251f41 Make tests typecheck 2007-05-08 15:24:49 +00:00
Don Stewart
9f4fd822b6 Arbitrary instance for StackSet must set random focus on each workspace
When focus was separated from the stack order on each workspace, we
forgot to update the Arbitrary instance to set random focus. As spotted
by David R, this then invalidates 4 of our QC properties. In particular,
the property involving where focus goes after a random transient
(annoying behaviour) appeared to be correct, but wasn't, due to
inadequate coverage.

This patch sets focus to a random window on each workspace. As a result,
we now catch the focus/raise/delete issue people have been complaining
about.

Lesson: make sure your QuickCheck generators are doing what you think
they are.
2007-05-08 05:11:26 +00:00
David Roundy
ab27c7d48d make quickcheck tests friendlier to read. 2007-05-05 17:54:15 +00:00
Jason Creighton
ab0f3be0af make Properties.hs exit with failure on test failure 2007-05-05 17:43:57 +00:00
Jason Creighton
7a89f431b1 added mirrorLayout to mirror arbitrary layouts 2007-05-04 01:46:53 +00:00
Don Stewart
f5e8b2b6a8 -Wall police 2007-05-03 07:49:37 +00:00
Spencer Janssen
833d5ae357 Fix tests after StackSet changes 2007-05-02 20:16:22 +00:00
Spencer Janssen
1dff21001c First steps to adding floating layer 2007-05-02 19:59:17 +00:00
Don Stewart
af7c76d3fe check we never generate invalid stack sets 2007-04-30 06:59:46 +00:00
Don Stewart
4d9fa8bc98 view n . shift n . view i . shift i) x == x --> shift + view is invertible 2007-04-30 06:29:01 +00:00
Don Stewart
17f70344ec add rotate all and view idempotency tests 2007-04-30 05:57:51 +00:00
Don Stewart
14773f6300 push is idempotent 2007-04-30 05:43:45 +00:00
Don Stewart
89182406a8 add two properties relating to empty window managers 2007-04-30 05:10:16 +00:00
Don Stewart
0d7969be18 new QC property: opening a window only affects the current screen 2007-04-30 05:01:33 +00:00
Don Stewart
8097060259 a bit more precise about building non-empty stacksets for one test 2007-04-30 03:57:29 +00:00
Don Stewart
966da43176 move size into Properties.hs 2007-04-30 02:17:58 +00:00
Don Stewart
d5e73b70ae add fromList to Properties.hs 2007-04-29 03:58:23 +00:00
Spencer Janssen
ea94892e1c Remove toList 2007-04-26 00:57:13 +00:00
Alec Berryman
ba97db3f87 Arbitrary Word64 for running tests on amd64
Copied from Arbitrary Word8; I don't understand the coarbitrary definition and
the Word64 one may be erroneous, but Properties.hs now compiles and passes all
tests.
2007-04-19 10:46:52 +00:00
Don Stewart
bf0f487ca4 add 8 new QC tests, including tests of the layout algorithm 2007-04-19 04:08:33 +00:00
Don Stewart
b765cc9706 Parameterise StackSet by two index types, rather than breaking abstraction 2007-04-19 01:27:05 +00:00
Don Stewart
7806eb4c48 2 more properties for promote. 2007-04-19 00:12:01 +00:00
Don Stewart
cf2c9f7328 tweak loc count to match count_lines script 2007-04-18 22:47:25 +00:00
Don Stewart
f3f83af393 Promote now swaps focused window with master window
This means other windows are unaffected.
The change from the previous cycling behaviour was felt necessary, since
cycling isn't a terribly useful operation.

Some properties that hold:
    focus is unchanged by promotion
    promote is idempotent (promoting twice does nothing)
    the focused and master window will swap their positions in the stack
2007-04-18 22:42:36 +00:00
Spencer Janssen
5c9ad77fd5 Update propaganda. 2007-04-18 01:40:29 +00:00
David Roundy
dd03052041 define test to ensure LOC doesn't jump above 400. 2007-04-18 00:45:33 +00:00
Don Stewart
4b626ff729 and the tests still run 2007-04-11 08:15:00 +00:00
Jason Creighton
c6dcc9d869 fromList/toList have # of screens + another QC property 2007-04-11 04:42:15 +00:00
Jason Creighton
0c95f0c143 moved screen <-> workspace mapping from XMonad to StackSet 2007-04-10 06:27:31 +00:00
daniel
97638a648c added a quickcheck property 2007-03-28 02:53:37 +00:00
Don Stewart
2a3284a31a more QC properties on StackSets 2007-03-09 05:40:42 +00:00
Don Stewart
0ea4260a4c simpler type (no need to cache size, we *could* grow new stacks on demand now) 2007-03-09 04:36:38 +00:00
Don Stewart
7e2caa4707 simplify StackSet api even further (-15 loc) 2007-03-09 04:17:07 +00:00