mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
XMonad.Action.TreeSelect: Allow Pointer Events
If this is not done, trying to select another window with the mouse when the treeselect window is up, the X server executes a pointer/keyboard grab until `allowEvents' is called; which it never is and so both remain frozen indefinitely. C.f.: - xmonad/xmonad/issues/116 - xmonad/xmonad-contrib/issues/445
This commit is contained in:
parent
08a165df40
commit
c59805636d
@ -1,6 +1,7 @@
|
||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
{-# LANGUAGE MultiWayIf #-}
|
||||
-----------------------------------------------------------------------------
|
||||
-- |
|
||||
-- Module : XMonad.Actions.TreeSelect
|
||||
@ -522,18 +523,21 @@ moveWith f = do
|
||||
-- | wait for keys and run navigation
|
||||
navigate :: TreeSelect a (Maybe a)
|
||||
navigate = gets tss_display >>= \d -> join . liftIO . allocaXEvent $ \e -> do
|
||||
maskEvent d (exposureMask .|. keyPressMask .|. buttonReleaseMask) e
|
||||
maskEvent d (exposureMask .|. keyPressMask .|. buttonReleaseMask .|. buttonPressMask) e
|
||||
|
||||
ev <- getEvent e
|
||||
|
||||
if ev_event_type ev == keyPress
|
||||
then do
|
||||
if | ev_event_type ev == keyPress -> do
|
||||
(ks, _) <- lookupString $ asKeyEvent e
|
||||
return $ do
|
||||
mask <- liftX $ cleanMask (ev_state ev)
|
||||
f <- asks ts_navigate
|
||||
fromMaybe navigate $ M.lookup (mask, fromMaybe xK_VoidSymbol ks) f
|
||||
else return navigate
|
||||
| ev_event_type ev == buttonPress -> do
|
||||
-- See XMonad.Prompt Note [Allow ButtonEvents]
|
||||
allowEvents d replayPointer currentTime
|
||||
return navigate
|
||||
| otherwise -> return navigate
|
||||
|
||||
-- | Request a full redraw
|
||||
redraw :: TreeSelect a ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user