summaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2008-10-05 02:18:04 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2008-10-05 02:18:04 +0200
commit742d4ffe745dcfc55c1ed584e23d8a8f599c0c3b (patch)
tree6e04c80940509b8aaf8c59cb2148cc1634158387 /XMonad
parentfaac464c06c9bb5b0786c6e6de3ad75edeee8190 (diff)
downloadmetatile-742d4ffe745dcfc55c1ed584e23d8a8f599c0c3b.tar
metatile-742d4ffe745dcfc55c1ed584e23d8a8f599c0c3b.zip
add killWindow function
This is required to kill anything that is not focused, without having to focus it first. darcs-hash:20081005001804-23c07-ae429620b924fb5d9ef28f3356f59866326da7d6
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Operations.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/XMonad/Operations.hs b/XMonad/Operations.hs
index a4eb352..d98311c 100644
--- a/XMonad/Operations.hs
+++ b/XMonad/Operations.hs
@@ -77,14 +77,14 @@ manage w = whenX (not <$> isClient w) $ withDisplay $ \d -> do
unmanage :: Window -> X ()
unmanage = windows . W.delete
--- | Kill the currently focused client. If we do kill it, we'll get a
+-- | Kill the specified window. If we do kill it, we'll get a
-- delete notify back from X.
--
-- There are two ways to delete a window. Either just kill it, or if it
-- supports the delete protocol, send a delete event (e.g. firefox)
--
-kill :: X ()
-kill = withDisplay $ \d -> withFocused $ \w -> do
+killWindow :: Window -> X ()
+killWindow w = withDisplay $ \d -> do
wmdelt <- atom_WM_DELETE_WINDOW ; wmprot <- atom_WM_PROTOCOLS
protocols <- io $ getWMProtocols d w
@@ -95,6 +95,10 @@ kill = withDisplay $ \d -> withFocused $ \w -> do
sendEvent d w False noEventMask ev
else killClient d w >> return ()
+-- | Kill the currently focused client.
+kill :: X ()
+kill = withFocused killWindow
+
-- ---------------------------------------------------------------------
-- Managing windows