31 Commits

Author SHA1 Message Date
slotThe
2469269119 New module: XMonad.Prelude
This is a convenience module in order to have less import noise.  It
re-exports the following:

  a) Commonly used modules in full (Data.Foldable, Data.Applicative, and
     so on); though only those that play nicely with each other, so that
     XMonad.Prelude can be imported unqualified without any problems.
     This prevents things like `Prelude.(.)` and `Control.Category.(.)`
     fighting with each other.

  b) Helper functions that don't necessarily fit in any other module;
     e.g., the often used abbreviation `fi = fromIntegral`.
2021-05-13 17:44:47 +02:00
Tomas Janousek
8cdbb5d422 X.L.SubLayouts: Fix focusWindow' being quadratic 2021-05-11 15:10:56 +01:00
Tomas Janousek
36d06c1c5d X.L.SubLayouts: Rewrite updateGroup, updateWs' using stack of stacks
A stack of stacks is a more natural representation of what SubLayouts
does: it packs information about the global focus as well as focus in
individual groups (sublayouts).

It doesn't carry information about the sublayouts themselves (but a
similar structure in X.L.Groups does), so we still use Groups and
fromGroups in some places, but future refactor can simplify that as
well, I'm sure.

My main motivation for this is that I need to expose the window groups
to the user config, and a stack of stacks seems to be a nice data
structure for that. The motivation for exposing the groups is that I
want to manipulate focus in a way that takes groups into account. As an
example, I want the following:

 * mod-1, mod-2 to mod-0 switches to n-th group if not already focused,
   and if focused, focus next in the group

 * show these numbers and window titles in xmobar (like tmux/screen/vim
   status line), like so:

     1a weechat  1b browser  2 vim  3 mutt

Achieving this just using BoringWindows is quite tricky, but with the
ability to somehow (InspectLayout, which is work-in-progress, or message
with IORef) get the stack of stacks out of SubLayouts, this becomes
easy.
2021-05-11 15:10:52 +01:00
Tomas Janousek
975a99d9dd X.L.SubLayouts: Simplify updateWs' using updateGroup
Turns out similar logic is already in updateGroup, and we don't even
need to worry about extra/missing windows and we can just differentiate
the result of reordering.
2021-05-11 15:09:40 +01:00
Tomas Janousek
9c93d90970 X.L.SubLayouts: Avoid moving floats to end of window stack
This makes the following sequence of operations idempotent, as it should be:

    windows $ W.float w $ W.RationalRect 0 0 1 1
    windows $ W.sink w

Previously, any window not visible to the SubLayout modifier (xmonad
invokes runLayout with tiled windows only) would be reordered to the end
of stack. This commit changes the reordering logic to only reorder
windows in Groups and keep all other windows where they were.
2021-05-11 15:09:40 +01:00
slotThe
78d526d1dd Get rid of unused imports
Starting with 5240116f3cdf169e3aa226d9f8206a5f5b99c867 we only support
GHC versions 8.4.4 and up (more precisely, the GHC version associated
with stackage lts-12 and up).  The imports in question are now in
Prelude and need not be imported explicitly.
2020-12-14 13:41:28 +01:00
slotThe
22aebcb26d Replace 'fmap f $ fa' with 'f <$> fa', apply functor laws 2019-10-08 11:13:02 +02:00
slotThe
53b57eba14 Replace liftM and fmap with <$> 2019-10-08 10:33:56 +02:00
slotThe
f3024e6779 Remove unnecessary imports of Control.Applicative 2019-10-08 10:21:15 +02:00
Daniel Wagner
0f1b6fb772 use Data.Default wherever possible, and deprecate the things it replaces 2013-05-28 01:39:09 +00:00
Daniel Wagner
daa2731d3d eliminate references to defaultConfig 2013-05-28 00:58:25 +00:00
Daniel Wagner
0287b2861c minimal change needed to get xmonad-contrib to build with xmonad's data-default patch 2013-05-28 00:10:40 +00:00
Adam Vogt
067ccb950e Export types to reduce haddock warnings. 2010-10-23 19:57:55 +00:00
Brent Yorgey
b435a6a519 suppress some warnings under ghc 6.12.1 and clean up redundant imports to get rid of some others. 2010-01-12 17:25:07 +00:00
Wirt Wolff
06a1322366 Docs: use myLayout like template rather than plural
Despite myLayouts currently being more popular in examples, make
them all myLayout as in man/xmonad.hs to avoid mixing them in the
same module as was done a few places, leading to confusion for some users.
2009-10-23 04:26:51 +00:00
Adam Vogt
f655307a1c Describe parameters to subLayouts more 2009-10-16 16:49:37 +00:00
Adam Vogt
8d4c0a5e13 Refer to modMask as modm in L.SubLayouts sample keybinds 2009-10-16 16:47:37 +00:00
Adam Vogt
f61ac3a174 Format L.SubLayout TODO 2009-10-16 15:58:37 +00:00
Adam Vogt
f28f32f7ed Add more links in L.SubLayout documentation 2009-10-16 15:55:18 +00:00
Adam Vogt
0e2aef4deb Link a screenshot in L.SubLayouts from the haskellwiki 2009-10-16 15:05:39 +00:00
Daniel Schoepe
e2113acd35 Factor out direction types and put them in X.U.Types
This patch factors out commonly used direction types like
data Direction = Prev | Next
and moves them to X.U.Types.
2009-09-19 19:17:17 +00:00
Adam Vogt
d65e40f09d Clarify documentation the Migrate message added to L.SubLayouts 2009-07-05 18:00:14 +00:00
Adam Vogt
f0c0f4d5c3 Reduce a bit of recently introduced duplication in L.SubLayouts 2009-07-05 17:51:45 +00:00
Adam Vogt
f8a4dd9503 Add Migrate message to L.SubLayouts, for better support of moving windows between groups 2009-07-05 17:49:34 +00:00
Adam Vogt
1f13242164 L.SubLayouts: also run the layout being modified in a restricted environment
This way, correct behavior can be expected if the layout runs ex. 'withWindowset
W.peek', instead of looking at its arguments.
2009-07-05 17:41:56 +00:00
Adam Vogt
48e74031f9 L.SubLayouts fix bug where previously run layouts would not get messages 2009-07-05 17:35:04 +00:00
Adam Vogt
1e1f2c6770 Keep track of whether messages should be given to new sublayouts in L.SubLayouts 2009-06-28 06:06:08 +00:00
Adam Vogt
1893d67d09 Run sublayouts in L.Sublayouts in a restricted state 2009-06-28 06:03:33 +00:00
Adam Vogt
cc84480c99 Correct many typos in the documentation, consistent US spellingg 2009-06-18 00:37:29 +00:00
Adam Vogt
06a997aaf9 Remove -XScopedTypeVariables requirement with L.SubLayouts
This should keep the code -Wall clean on ghc-6.8 in addition to ghc-6.10
2009-04-28 22:27:49 +00:00
Adam Vogt
115cd5af95 Add SubLayouts: a layout combinator for nesting layouts. 2009-04-23 01:31:35 +00:00