17 Commits

Author SHA1 Message Date
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
9451d81427 Apply two xmonad core fixes to float moving/resizing in various contrib modules
This applies fixes from
4565e2c90e
and
b9ce5b034b.

tl;dr:
When dragging, refloat and refresh to fix https://github.com/xmonad/xmonad/issues/63.
When starting dragging, raising the window is then unnecessary, and
removing it fixes https://github.com/xmonad/xmonad/issues/208.
Also remove unnecessary raises for keyboard moving/resizing which always
refloated the window.

Fixes: https://github.com/xmonad/xmonad/issues/63
Fixes: https://github.com/xmonad/xmonad/issues/208
2021-02-16 12:23:28 +00: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
Bogdan Sinitsyn
c48d81e378 Fix caching issues in ManageDocks
Commits d638dc8b and a5e87e38 introduced a per-AvoidStruts-instance
strut cache that

a) didn't get initialized at startup,
b) didn't get reinitialized after layout reset and
c) didn't get updates if it wasn't the active layout, for example when
   layoutHook = avoidStruts tall ||| avoidStruts (mirror tall)

a) + b) could be fixed by using the docksStartupHook introduced in
28e9f8bc, although this wasn't documented and having to call
docksStartupHook after setLayout is far from obvious.

By moving the strut cache from AvoidStruts instances to a global state,
b) and c) are fixed. One still has to invoke the docksStartupHook for
a), and this will be addressed in the next commit.
2016-09-07 13:26:50 +03:00
Bogdan Sinitsyn
f1b9a0c193 add calcGapForAll for other modules 2016-01-17 10:35:26 +03:00
ankaan
b2531a6f48 X.L.AvoidFloats, like avoidStruts but for floats
Checks for floating windows within the layout area and finds a maximum area
rectangle within that does not overlap with any of the floating windows.
This rectangle is used for all non-floating windows.

This new functionality introduced problems with the recommended configuration
of one of my other modules (X.A.FloatSnap.) A new and more reliable method of
distinguishing between clicks and drags where therefore introduced in the new
module X.A.AfterDrag.

This does not break any prior use of FloatSnap, but will require changes in
configuration if used together with AvoidFloats. (This is mentioned in the
docs for AvoidFloats and I recommend using the new configuration method even if
AvoidFloats is not in use.)
2015-03-06 17:17:02 +00:00
Adam Vogt
74a03cd8fb Refer to modm as the current modMask
This makes the config suggestions consistent with the current template.
2009-10-22 04:11:26 +00:00
Adam Vogt
63b6d7c225 Add a SetStruts message to H.ManageDocks.
This patch also uses Data.Set instead of [] for the AvoidStruts
constructor to simplify the SetStruts implementation.
2009-10-05 16:42:21 +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
Anders Engstrom
c5b5db500b FloatSnap - calculate gaps instead of snapping against unmanaged windows
This patch will remove snapping against unmanaged windows, but instead calculate a new rectangle with all gaps (computed by ManageDocks) removed. This new rectangle is used to snap against. (Both the inside and outside of the rectangle.)

This will remedy the issue of snapping against multiple layers of the same window, additionally there will be no snap-points between windows on the same side. So if you are running two dzen side by side with half the screen each. You will not automatically have a snap-point in the middle.

Naturally, this patch will change which function is exported from ManageDocks.
2009-05-26 22:29:42 +00:00
Adam Vogt
49bb2655ff A.FloatSnap snap to unmanaged docks too 2009-05-25 00:18:34 +00:00
Anders Engstrom
1fd4489ae6 FloatSnap fix maintainer 2009-05-24 20:58:54 +00:00
Anders Engstrom
bc425079f2 X.A.FloatSnap - More configuration for magic resize, adaption for mouse bindings and some minor fixes 2009-05-24 20:11:43 +00:00
Anders Engstrom
bd7e2004a0 X.A.FloatSnap - Assisted move/resize of windows
TODO: Try to snap against unmanaged windows such as dzen/xmobar.
2009-05-23 23:52:30 +00:00