Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MVDT: Simplify the design of the manage hook
`ManageHook` as `Query (Endo WindowSet)` is a holdover from The Old Way. `Query` wraps the `X` Monad, which already collects and composes changes to the windowset. As such, the `Endo WindowSet` is redundant. Worse, the way these changes compose is not at all obvious or intuitive. Suppose you compose two ManageHook values: manageHook = (qF $> Endo f) <> (qG $> Endo g) The result of running the `manageHook` on some `w` is not, as one might guess, do runQuery qF w windows f runQuery qG w windows g nor is it do runQuery qF w runQuery qG w windows f windows g Unfortunately, it is: do runQuery qF w runQuery qG w windows g windows f This is a wart, and it's one we can now excise. Hence the `ManageHook` type synonym is simplified to `Query ()`, and `manage` runs the hook as-is. It also performs the initial handling of the window beforehand, so it's fully visible within the hook. As such, `willFloat` (which repeats the indirect logic in `manage`) is deprecated in favour of `isFloat`, which directly references the model. Note that this change also allows cleaner syntax in configuration. E.g. manageHook = composeAll [ test1 --> fooHook , test2 --> barQueryAction >> idHook , test3 --> fooHook <> bazHook <> quuxHook ] can become manageHook = do test1 --> fooHook test2 --> barQueryAction test3 --> do fooHook bazHook quuxHook To accomodate the change, `doF` must become a lifted `windows`, but that and monoid-polymorphism take care of adjusting the rest of the core interface transparently. As such, simple configs will continue to compile, but extensions that directly interfered with the old `Endo WindowSet` won't. Further, due to `doF`s now composing forwards rather than backwards, many user configs will break silently. The solution is to reverse the order that `doF`, `doFloat`, `doIgnore` and `doShift` appear in, extending that list to include anything else built on `doF`, like `doShiftTo` or `doFullFloat` from `X.H.ManageHelpers`.
- Loading branch information