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.
This commit is contained in:
Ben Boeckel 2011-05-15 21:03:12 +00:00
parent 9f65044be5
commit a9d1ce1efc

View File

@ -76,6 +76,7 @@ submapDefault def keys = do
else return (m, keysym) else return (m, keysym)
-- Remove num lock mask and Xkb group state bits -- Remove num lock mask and Xkb group state bits
m' <- cleanMask $ m .&. ((1 `shiftL` 12) - 1) m' <- cleanMask $ m .&. ((1 `shiftL` 12) - 1)
maybe def id (M.lookup (m', s) keys)
io $ ungrabKeyboard d currentTime io $ ungrabKeyboard d currentTime
maybe def id (M.lookup (m', s) keys)