24 Commits

Author SHA1 Message Date
Tony Zorman
e85f0151b2 X.A.VisualSubmap: Fix example 2023-01-11 16:50:42 +01:00
Tony Zorman
3d65a6bf72 Refer to the tutorial instead of X.D.Extending more often
Essentially, whenever the tutorial actually has decent material on the
subject matter.  The replacement is roughly done as follows:

  - logHook → tutorial
  - keybindings → tutorial, as this is thoroughly covered
  - manageHook → tutorial + X.D.Extending, as the manageHook stuff the
    tutorial talks about is a little bit of an afterthought.
  - X.D.Extending (on its own) → tutorial + X.D.Extending
  - layoutHook → tutorial + X.D.Extending, as the tutorial, while
    talking about layouts, doesn't necessarily have a huge focus there.
  - mouse bindings → leave this alone, as the tutorial does not at all
    talk about them.
2022-10-21 09:17:43 +02:00
Tomas Janousek
12c5518852 X.A.Submap, X.Prompt: Use cleanKeyMask
This replaces the custom `cleanMask` extension in these modules—which
only filtered out XKB group bits and Button5Mask¹—with the new
`cleanKeyMask` which additionally filters out all mouse buttons, as
these aren't relevant for key bindings.

¹) Filtering out Button5Mask was probably an off-by-one mistake.

Fixes: https://github.com/xmonad/xmonad-contrib/issues/290
Related: https://github.com/xmonad/xmonad-contrib/pull/590
2022-02-10 14:23:01 +00:00
slotThe
cf1d966ee6 X.A.Submap: Add visualSubmap
Add a `visualSubmap` function, which works much like the regular
`submap` one, except that it visualises the available choices in a
pop-up window.

Related: https://github.com/xmonad/xmonad-contrib/issues/472
2022-02-03 08:53:33 +01: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
Tomas Janousek
91995df559 X.A.Submap, X.U.Ungrab: Sync after ungrab (fixes issues with runProcessWithInput)
When `runProcessWithInput` is invoked immediately after
`ungrabPointer`/`ungrabKeyboard`, we don't actually ungrab at all
because `runProcessWithInput` blocks and the ungrab requests wait in
Xlib's queue for a requests that needs a queue flush.

Common uses of `unGrab` (before `spawn`) aren't followed by a blocking
action, so the ungrab requests are flushed by xmonad's main loop, and
this is merely a timing issue—fork/exec takes a while and xmonad
probably manages to get back to its main loop in time. Uses of
`runProcessWithInput` in ordinary non-submap key bindings happen to work
because key bindings are passive grabs—the grab is released by the
user's fingers releasing the key itself, even if xmonad's ungrab
requests are stuck in a blocked queue. Submap key bindings, however,
take an active grab and therefore need to ungrab explicitly.

Easy fix—explicit `sync`.

Fixes: https://github.com/xmonad/xmonad/issues/313
2021-08-08 16:05:49 +01: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
sgf
b9d8f6ce34 X.A.Submap: establish pointer grab to avoid freezing X.
Establish active asynchronous pointer grab before entering infinity cycle.
Because xmonad already has passive synchronous pointer grab, this overwrites
it temporary and avoids freezing X, when button press occurs after submap key
press.

Also, terminate submap at button press in the same way, as we do for wrong key
press.
2016-12-09 12:38:33 +03:00
Matus Goljer
e5ca066057 Add submapDefaultWithKey.
This is useful for when we want to decide what to do in the default
action based on the key that failed to match in the submap.
2016-10-16 16:40:13 +02:00
Matus Goljer
444986d993 Remove unneeded argument 2016-10-16 16:36:18 +02:00
Matus Goljer
1553d81ce7 Use fromMaybe over "maybe .. id" 2016-10-16 16:33:49 +02:00
Daniel Wagner
0f1b6fb772 use Data.Default wherever possible, and deprecate the things it replaces 2013-05-28 01:39:09 +00:00
Ben Boeckel
a9d1ce1efc ungrab-keyboard-before-action
If an action that requires the keyboard to be grabbed (e.g., launching dmenu),
it is a race when submapping the action as to whether the action will have
access to the keyboard or not. To fix this, the keyboard should be ungrabbed
before executing the action.
2011-05-15 21:03:12 +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
Khudyakov Alexey
c884dbb74b Clean Xkb masks in X.A.Submap
Xkb adds its own mask and prevent Submap keybindings from normal
functioning when alternate layout is used. This patch cleans
these masks.
2009-06-23 16:46:53 +00:00
Anders Engstrom
823ea115ae submapDefault fix key leakage 2009-04-26 17:10:02 +00:00
Anders Engstrom
b39dfa1917 submapDefault
Add support for a default action to take when the entered key does not match any entry.
2009-01-18 15:29:33 +00:00
Spencer Janssen
3a522e7e3c Remove XMonad.Operations imports 2007-12-08 00:05:47 +00:00
Spencer Janssen
4f7764ca8b Prune more imports 2007-12-07 23:51:16 +00:00
Spencer Janssen
dc11825588 Remove redundant imports 2007-12-07 23:38:27 +00:00
Brent Yorgey
eb6c642fd9 SimpleDate, Submap: modMask --> modMask x 2007-11-27 19:20:39 +00:00
Brent Yorgey
0cce3cff7e Submap: haddock updates 2007-11-27 19:18:41 +00:00
Spencer Janssen
2bb992c128 -Wall police 2007-11-05 06:00:36 +00:00
Spencer Janssen
cd1884466a Hierarchify 2007-11-01 20:10:59 +00:00