17 Commits

Author SHA1 Message Date
L. S. Leary
a52e646cc1 Extract redundant layouts into new module: X.L.FocusTracking
X.L.StateFull's `FocusTracking` and the eponymous `TrackFloating` were
redundant, hence the former was slated for deprecation. However,
the latter and its host module are somewhat poorly named; the layout
modifier has little relation to floats. As such, it's renamed and
rehosted, becoming the eponymous `FocusTracking`.

The redundant offerings in the original modules are redefined in terms
of the new module where possible, and deprecated.

See: #418; comments on #253, #783.
2023-02-12 20:20:52 +13:00
slotThe
38c11c1e3c Add "Description" field to module headers
Fixes: https://github.com/xmonad/xmonad-contrib/issues/592
2021-09-26 14:15:54 +02:00
slotThe
bd5b969d9b Apply hlint hints
All hints are applied in one single commit, as a commit per hint would
result in 80+ separate commits—tihs is really just too much noise.

Related: https://github.com/xmonad/xmonad-contrib/issues/537
2021-06-06 18:59:05 +02:00
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
43592c84d4 X.L.TrackFloating: Fix changing focus on inactive workspaces
When focus changes¹ on an inactive workspace (not `current`, but
`visible`), TrackFloating and UseTransientFor would think they should
use the remembered focus point as they look at the wrong (`current`)
workspace instead of the workspace they're supposed to layout, and so
focus seems to be out of their set of windows, when actually it is not.

Fix this by looking at the correct workspace.

¹) This isn't entirely straightforward, as there are normally no
   keybindings or StackSet operations for this, but it's perfectly legal
   to `W.view` the inactive workspace, change focus, and `W.view` back
   in a single `windows` action.
2021-02-15 17:25:48 +00:00
Tomas Janousek
89dbdd4767 X.L.TrackFloating: Simplify focus logic
It seems the logic used in X.L.StateFull's FocusTracking should cover
all use cases here. Let's try it for a while. :-)
2020-12-09 00:20:41 +00:00
Tomas Janousek
0e9c865e72 X.L.TrackFloating: Drop redundant _wasFloating
It was added in 81d338952d in an attempt to fix focus handling after
closing a floating window, but shortly after made redundant in
a551d1367c when we noticed it causes more harm than good. Unfortunately
it wasn't fully reverted, making the code more complex than necessary.

Drop the remaining bits.

Now it's almost obvious that the only difference between this and
X.L.StateFull.FocusTracking is the isF condition.

BTW the original issue 81d338952d was trying to fix can be fixed by
using X.H.RefocusLast, from the author of X.L.StateFull.FocusTracking.
:-)
2020-12-09 00:20:41 +00:00
Tomas Janousek
8afd51517c X.L.TrackFloating: Simplify by using X.U.Stack.findZ
X.L.TrackFloating is more or less the same as X.L.StateFull's
FocusTracking, so it's no surprise the same helpers can be used...
2020-12-09 00:20:41 +00:00
slotThe
22aebcb26d Replace 'fmap f $ fa' with 'f <$> fa', apply functor laws 2019-10-08 11:13:02 +02:00
slotThe
0b26ddf489 Replace liftM2 with liftA2 2019-10-08 10:41:14 +02:00
Daniel Wagner
daa2731d3d eliminate references to defaultConfig 2013-05-28 00:58:25 +00:00
Adam Vogt
a33f355232 Update L.TrackFloating.useTransient example code
Suggest useTransient goes to the right of trackFloating which is the
configuration actually tested.
2013-01-12 04:12:39 +00:00
Adam Vogt
ced8f5e0f0 Adapt ideas of issue 306 patch to a new modifier in L.TrackFloating 2013-01-12 03:57:01 +00:00
Adam Vogt
a551d1367c Restore TrackFloating behavior to an earlier version.
Thanks for liskni_si for pressing the matter: without this change it is very
broken, with the patch it is still not perfect but still useful.
2011-11-20 04:55:38 +00:00
Adam Vogt
b1ff22411d X.L.TrackFloating docs and help nested layouts
Now TrackFloating remembers focus for the given layout when the other window is
also tiled, but not fed to the given layout: this helps with X.L.IM, among
others.
2010-10-30 17:56:15 +00:00
Adam Vogt
81d338952d Fix bug in L.TrackFloating
Addresses the comment that:

If the focus goes from the floating layer to tiling by deleting a floating
window, it's again the master window that gets focus, not the remembered
window.
2010-10-30 00:06:20 +00:00
Adam Vogt
25889f2d0c Add X.L.TrackFloating for tiled-floating focus issues (#4) 2010-10-16 16:55:36 +00:00