Commit Graph

65 Commits

Author SHA1 Message Date
Don Stewart
777cf28bdf clean up mouse code a bit 2007-05-31 08:53:08 +00:00
Jason Creighton
3cb64d7461 first shot at a floating layer
This is a first attempting at a floating layer:

mod-button1: move window
mod-button2: swapMaster
mod-button3: resize window

mod-t: make floating window tiled again

Moving or resizing a window automatically makes it floating.

Known issues:

Hard to manage stacking order. You can promote a window to move it to the top,
(which you can do with mod-button2) but it should be easier than that.

Moving a window by dragging it to a different Xinerama screen does not move it
to that workspace.

Code is ugly.
2007-05-31 04:47:33 +00:00
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
Don Stewart
6346e11ff6 type sig for abort. 2007-05-26 06:14:50 +00:00
Neil Mitchell
a5aa4b1686 Add an abort function, called for deliberate and intentional errors 2007-05-23 23:32:12 +00:00
Rob
f8caf7f982 Deleting a window should not affect focus
This fixes a bug whereby deleting a window will first move focus to
that window before deleting it without moving focus back afterwards.

The fix generalises the remove inner function to delete a window from
the stack whether it's in focus or not. If the window is in focus,
behaviour remains as it was.
2007-05-25 02:41:18 +00:00
bobstopper
bcf305cd1e add swapLeft and swapRight 2007-05-22 05:00:08 +00:00
Spencer Janssen
127fd0b309 Read instance for StackSet 2007-05-21 18:45:04 +00:00
Don Stewart
b1345e037c modify 2007-05-21 11:57:50 +00:00
Don Stewart
ea80d2a71f Move xinerama current/visible/hidden workspace logic into StackSet directly. 2007-05-21 05:52:53 +00:00
Jason Creighton
5c44fa79fd focusWindow: always view the containing workspace first 2007-05-21 03:55:51 +00:00
Don Stewart
d28d4251e0 explicit export list for StackSet 2007-05-21 02:52:50 +00:00
Don Stewart
d3d058345d comment only 2007-05-20 09:08:46 +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
Spencer Janssen
f9af744b1e Read is not needed for StackSet 2007-05-16 05:42:33 +00:00
David Roundy
54ee507cca keep focus stack. 2007-05-10 13:16:37 +00:00
Spencer Janssen
c5c958dc2c Remove unsafe fromJust 2007-05-08 16:38:22 +00:00
Neil Mitchell
97141b9a07 Work around the fact that Yhc gets defaulting a bit wrong 2007-05-08 12:49:49 +00:00
Spencer Janssen
a846eb18ff Remove unsafe use of head 2007-05-08 15:21:16 +00:00
Spencer Janssen
f03ca10714 Make 'index' return Nothing, rather than error 2007-05-08 15:12:00 +00:00
Spencer Janssen
ba9e15e772 Use 'drop 1' rather than tail, skip equality check. 2007-05-08 15:09:43 +00:00
Spencer Janssen
1276edc861 StackSet.view: ignore invalid indices 2007-05-08 14:39:51 +00:00
Neil Mitchell
27f1f50071 Change the swap function so its Haskell 98, by using list-comps instead of pattern-guards. 2007-05-08 12:31:58 +00:00
David Roundy
ab27c7d48d make quickcheck tests friendlier to read. 2007-05-05 17:54:15 +00:00
Spencer Janssen
bedc069143 Add -fglasgow-exts for pattern guards. Properties.hs doesn't complain anymore 2007-05-03 21:42:21 +00:00
Spencer Janssen
1dff21001c First steps to adding floating layer 2007-05-02 19:59:17 +00:00
Don Stewart
df7d1d95fa remove redundant call to 'delete' in 'shift' 2007-04-30 03:11:51 +00:00
Don Stewart
8265cae8a8 clean 'delete' a little 2007-04-30 02:53:19 +00:00
Don Stewart
a07f0778ad shrink 'swap' 2007-04-30 02:48:13 +00:00
Don Stewart
9fafa995c7 shrink 'rotate' a little 2007-04-30 02:45:25 +00:00
Don Stewart
966da43176 move size into Properties.hs 2007-04-30 02:17:58 +00:00
Don Stewart
a839238483 don't need 'size' operation on StackSet 2007-04-30 01:59:27 +00:00
Don Stewart
9b80a36cf8 move fromList into Properties.hs, -17 loc 2007-04-29 03:58:04 +00:00
Spencer Janssen
ea94892e1c Remove toList 2007-04-26 00:57:13 +00:00
Don Stewart
bf0f487ca4 add 8 new QC tests, including tests of the layout algorithm 2007-04-19 04:08:33 +00:00
Spencer Janssen
c858e0be4e Remove useless pragma 2007-04-19 01:52:39 +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
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
Don Stewart
4b626ff729 and the tests still run 2007-04-11 08:15:00 +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
10a9f73be8 merge with toList/fromList patch 2007-04-11 06:09:47 +00:00
Don Stewart
c490333d12 Statically distinguish Workspace and Screen indices 2007-04-11 06:04:56 +00:00
Jason Creighton
c6dcc9d869 fromList/toList have # of screens + another QC property 2007-04-11 04:42:15 +00:00
Jason Creighton
ac913104a5 Xinerama screen switching bugfix 2007-04-11 04:16:15 +00:00
Jason Creighton
0c95f0c143 moved screen <-> workspace mapping from XMonad to StackSet 2007-04-10 06:27:31 +00:00
Alec Berryman
df4bda60ff Remove trailing spaces, no content changed 2007-04-01 14:45:39 +00:00
Don Stewart
b3dbe98e64 formatting only 2007-04-01 00:47:26 +00:00
daniel
5e6407df7f allow mouse to change current workspace 2007-03-28 10:34:35 +00:00
Spencer Janssen
a05115bb72 Add promote 2007-03-22 22:15:47 +00:00