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 GeneralizedNewtypeDeriving #-}
|
||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE RecordWildCards #-}
|
{-# LANGUAGE RecordWildCards #-}
|
||||||
|
{-# LANGUAGE MultiWayIf #-}
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- |
|
-- |
|
||||||
-- Module : XMonad.Actions.TreeSelect
|
-- Module : XMonad.Actions.TreeSelect
|
||||||
@ -522,18 +523,21 @@ moveWith f = do
|
|||||||
-- | wait for keys and run navigation
|
-- | wait for keys and run navigation
|
||||||
navigate :: TreeSelect a (Maybe a)
|
navigate :: TreeSelect a (Maybe a)
|
||||||
navigate = gets tss_display >>= \d -> join . liftIO . allocaXEvent $ \e -> do
|
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
|
ev <- getEvent e
|
||||||
|
|
||||||
if ev_event_type ev == keyPress
|
if | ev_event_type ev == keyPress -> do
|
||||||
then do
|
(ks, _) <- lookupString $ asKeyEvent e
|
||||||
(ks, _) <- lookupString $ asKeyEvent e
|
return $ do
|
||||||
return $ do
|
mask <- liftX $ cleanMask (ev_state ev)
|
||||||
mask <- liftX $ cleanMask (ev_state ev)
|
f <- asks ts_navigate
|
||||||
f <- asks ts_navigate
|
fromMaybe navigate $ M.lookup (mask, fromMaybe xK_VoidSymbol ks) f
|
||||||
fromMaybe navigate $ M.lookup (mask, fromMaybe xK_VoidSymbol ks) f
|
| ev_event_type ev == buttonPress -> do
|
||||||
else return navigate
|
-- See XMonad.Prompt Note [Allow ButtonEvents]
|
||||||
|
allowEvents d replayPointer currentTime
|
||||||
|
return navigate
|
||||||
|
| otherwise -> return navigate
|
||||||
|
|
||||||
-- | Request a full redraw
|
-- | Request a full redraw
|
||||||
redraw :: TreeSelect a ()
|
redraw :: TreeSelect a ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user