mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-16 12:33:47 -07:00
implement the ICCCM WM_TAKE_FOCUS protocol
This commit is contained in:
@@ -26,7 +26,7 @@ module XMonad.Core (
|
|||||||
runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers, uninstallSignalHandlers,
|
runX, catchX, userCode, userCodeDef, io, catchIO, installSignalHandlers, uninstallSignalHandlers,
|
||||||
withDisplay, withWindowSet, isRoot, runOnWorkspaces,
|
withDisplay, withWindowSet, isRoot, runOnWorkspaces,
|
||||||
getAtom, spawn, spawnPID, xfork, getXMonadDir, recompile, trace, whenJust, whenX,
|
getAtom, spawn, spawnPID, xfork, getXMonadDir, recompile, trace, whenJust, whenX,
|
||||||
atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, ManageHook, Query(..), runQuery
|
atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, atom_WM_TAKE_FOCUS, ManageHook, Query(..), runQuery
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import XMonad.StackSet hiding (modify)
|
import XMonad.StackSet hiding (modify)
|
||||||
@@ -204,10 +204,11 @@ getAtom :: String -> X Atom
|
|||||||
getAtom str = withDisplay $ \dpy -> io $ internAtom dpy str False
|
getAtom str = withDisplay $ \dpy -> io $ internAtom dpy str False
|
||||||
|
|
||||||
-- | Common non-predefined atoms
|
-- | Common non-predefined atoms
|
||||||
atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, atom_WM_STATE :: X Atom
|
atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW, atom_WM_STATE, atom_WM_TAKE_FOCUS :: X Atom
|
||||||
atom_WM_PROTOCOLS = getAtom "WM_PROTOCOLS"
|
atom_WM_PROTOCOLS = getAtom "WM_PROTOCOLS"
|
||||||
atom_WM_DELETE_WINDOW = getAtom "WM_DELETE_WINDOW"
|
atom_WM_DELETE_WINDOW = getAtom "WM_DELETE_WINDOW"
|
||||||
atom_WM_STATE = getAtom "WM_STATE"
|
atom_WM_STATE = getAtom "WM_STATE"
|
||||||
|
atom_WM_TAKE_FOCUS = getAtom "WM_TAKE_FOCUS"
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- LayoutClass handling. See particular instances in Operations.hs
|
-- LayoutClass handling. See particular instances in Operations.hs
|
||||||
|
@@ -325,7 +325,8 @@ setFocusX w = withWindowSet $ \ws -> do
|
|||||||
|
|
||||||
-- If we ungrab buttons on the root window, we lose our mouse bindings.
|
-- If we ungrab buttons on the root window, we lose our mouse bindings.
|
||||||
whenX (not <$> isRoot w) $ setButtonGrab False w
|
whenX (not <$> isRoot w) $ setButtonGrab False w
|
||||||
io $ setInputFocus dpy w revertToPointerRoot 0
|
io $ do setInputFocus dpy w revertToPointerRoot 0
|
||||||
|
-- raiseWindow dpy w
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- Message handling
|
-- Message handling
|
||||||
|
Reference in New Issue
Block a user