Commit Graph

45 Commits

Author SHA1 Message Date
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
Don Stewart
0928bb484a Constrain layout messages to be members of a Message class
Using Typeables as the only constraint on layout messages is a bit
scary, as a user can send arbitrary values to layoutMsg, whether they
make sense or not: there's basically no type feedback on the values you
supply to layoutMsg.

Folloing Simon Marlow's dynamically extensible exceptions paper, we use
an existential type, and a Message type class, to constrain valid
arguments to layoutMsg to be valid members of Message.

That is, a user writes some data type for messages their layout
algorithm accepts:

  data MyLayoutEvent = Zoom
                     | Explode
                     | Flaming3DGlassEffect
                     deriving (Typeable)

and they then add this to the set of valid message types:

  instance Message MyLayoutEvent

Done. We also reimplement the dynamic type check while we're here, to
just directly use 'cast', rather than expose a raw fromDynamic/toDyn.

With this, I'm much happier about out dynamically extensible layout
event subsystem.
2007-05-04 08:16:49 +00:00
Spencer Janssen
9d3d2f8503 More Config.hs bugs 2007-05-03 23:46:07 +00:00
Spencer Janssen
204c90b072 Revert accidental change to Config.hs 2007-05-03 23:31:48 +00:00
David Roundy
ea1134db26 add support for extensible layouts. 2007-05-03 14:47:50 +00:00
Don Stewart
08ce2a5efa elaborate documentation in Config.hs 2007-05-03 07:48:43 +00:00
Spencer Janssen
3416eceb5d Add 'mod-n': refreshes current layout 2007-05-03 00:22:52 +00:00
Spencer Janssen
3586379ecc Make border width configurable 2007-04-30 16:35:15 +00:00
Spencer Janssen
08e514b28f Add Config.hs-boot, remove defaultLayoutDesc from XConf 2007-04-30 16:26:47 +00:00
Jason Creighton
bdbca84bcd configurable border colors
This also fixes a bug where xmonad was assuming a 24-bit display, and just
using, eg, 0xff0000 as an index into a colormap without querying the X server
to determine the proper pixel value for "red".
2007-04-30 04:38:59 +00:00
Spencer Janssen
0dd75f9d68 Further refactoring 2007-04-26 21:22:57 +00:00
Spencer Janssen
bd41b81c16 Refactor in Config.hs (no real changes) 2007-04-26 21:14:07 +00:00
Jason Creighton
767bc68acf Ignore numlock and capslock in keybindings 2007-04-24 01:33:57 +00:00
Jason Creighton
62acb87662 added comment about windows key (mod4Mask) 2007-04-15 23:36:35 +00:00
Jason Creighton
4b291d7e8a remove unused sizeDelta setting 2007-04-15 23:32:44 +00:00
Jason Creighton
899d470c4d added warning re: xmonad in path to mod-shift-q docs 2007-04-13 23:30:19 +00:00
Spencer Janssen
5fb81a781d Clear up documentation on mod-h/l 2007-04-13 23:07:06 +00:00
Alec Berryman
39cf207766 mod-wer for Xinerama was inadvertently changed 2007-04-12 13:20:33 +00:00
Don Stewart
a37193f2a6 add license headers to two missing files 2007-04-11 08:10:42 +00:00
Don Stewart
56c4a62468 explain what mod-return now does. it cycles 2007-04-11 07:36:36 +00:00
Don Stewart
e9597b4899 Change semantics of 'promote'.
Previously 'promote' would move the currently focused window into the
master position in tiled mode. This was *almost* a cycle of the windows,
but not quite (depending on where the focus was, it was in fact a
cycle).

Now we do the obvious generalisation, and just cycle the current window
stack. Simpler to understand, simpler to reason about.
2007-04-11 07:34:56 +00:00
Don Stewart
c490333d12 Statically distinguish Workspace and Screen indices 2007-04-11 06:04:56 +00:00
Spencer Janssen
be223c35f4 Move workspace fetching logic from Config.hs to Operations.hs 2007-04-10 06:47:14 +00:00
Jason Creighton
0c95f0c143 moved screen <-> workspace mapping from XMonad to StackSet 2007-04-10 06:27:31 +00:00
Don Stewart
89dbd331dc summarise key bindings in a table in Config.hs 2007-04-04 01:14:41 +00:00
Spencer Janssen
3a592d2df8 Use Tall and Wide for split screen layouts. This should be less confusing. 2007-04-03 05:06:10 +00:00
Alec Berryman
8c58c998db Comment typo: more -> move 2007-04-02 22:19:48 +00:00
Spencer Janssen
93be71bb88 Revert to the old layout code. 2007-04-02 04:51:14 +00:00
Alec Berryman
8d1deb69eb Type error: lockMask :: KeyMask, not KeySym
Error prevents compilation on 64-bit systems.
2007-04-01 14:34:16 +00:00
Alec Berryman
14282027e6 Suggest an alternative modMask for emacs users 2007-04-01 16:10:27 +00:00
Jason Creighton
b4076c2ac2 Config.hs comment formatting/typo 2007-04-01 05:57:11 +00:00
Don Stewart
bb1c1cf062 sanitize key bindings
Changes mean:

* gmrun is like the dmenu key, but with shift set. 
    -    , ((modMask .|. shiftMask, xK_F11   ), spawn "gmrun")
    +    , ((modMask .|. shiftMask, xK_p     ), spawn "gmrun")

 If no one actually uses both gmrun and dmenu, we should consider only
 using mod-p for this.

* restart is like quit, but with 'ctrl' set:
    +    , ((modMask .|. shiftMask, xK_q                     ), io $ exitWith ExitSuccess)
    +    , ((modMask .|. shiftMask .|. controlMask, xK_q     ), io restart)

* revert to 'wer' ordering for xinerama screens:
    -        | (key, sc) <- zip [xK_e, xK_r, xK_t] [1..]
    +        | (key, sc) <- zip [xK_w, xK_e, xK_r] [1..]

that's the only binding order that makes sense, since they're meant to
refer to screens 1 2 and 3, hence 'wer' (look at the keyboard to see why)
2007-04-01 03:35:22 +00:00
Don Stewart
cf91d8aa53 restore dwm-style keybindings. mod-shift-{j,k} resize in vert mode 2007-04-01 02:54:33 +00:00
hughes
1909c353b7 Merged things together with dons changes. 2007-04-01 02:18:46 +00:00
hughes
1768981f90 Config.hs avoids conflict with essential M-w Emacs shortcut. 2007-04-01 01:51:35 +00:00
hughes
10a0e21e00 Vertical/horizontal split, and resizability. 2007-04-01 01:47:06 +00:00
hughes
75187c4b41 Remove evil gmrun shortcut. 2007-03-30 14:45:58 +00:00
Don Stewart
b3dbe98e64 formatting only 2007-04-01 00:47:26 +00:00
Jason Creighton
ec38d07940 whitespace 2007-03-27 01:33:50 +00:00
hughes
79d64f2b19 Config supports Ctrl+Space for gmrun again. 2007-03-26 15:12:43 +00:00
hughes
4fc3448186 Workspace-specific layouts 2007-03-26 15:02:13 +00:00
Alec Berryman
bffb0126e0 Typo: use dmenu_path instead of emenu_path 2007-03-26 14:03:35 +00:00
daniel
cb4e6d86a1 Extra config: defaultLayout 2007-03-26 07:42:34 +00:00
Jason Creighton
bfae1e5cb6 Config.lhs -> Config.hs 2007-03-26 05:40:04 +00:00