XMonad.Util.Ungrab

xmonad-contrib-0.13: Third party extensions for xmonad

Copyright | (c) 2016 Brandon S Allbery
License | BSD-style (see xmonad/LICENSE)
Maintainer | allbery.b@gmail.com
Stability | unstable
Portability | unportable
Safe Haskell | None
Language | Haskell98

XMonad.Util.Ungrab

Contents

- Usage:

Description

Allow releasing xmonad's keyboard grab

Synopsis

- unGrab :: X ()

# Usage:

Start a keyboard action with this if it is going to run something that needs to do a keyboard, pointer, or server grab. For example,

    , ((modm .|. controlMask, xK_p), unGrab >> spawn "scrot")

(Other examples are screen lockers and "gksu".) This avoids needing to insert a pause/sleep before running the command.

xmonad retains the keyboard grab during key actions because if they use a Submap, they need the keyboard to be grabbed, and if they had to assert their own grab then the asynchronous nature of X11 allows race conditions between xmonad, other clients, and the X server that would cause keys to sometimes be "leaked" to the focused window.

unGrab :: X () #

Release xmonad's keyboard grab, so other grabbers can do their thing.