From 742d4ffe745dcfc55c1ed584e23d8a8f599c0c3b Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Sun, 5 Oct 2008 02:18:04 +0200 Subject: add killWindow function This is required to kill anything that is not focused, without having to focus it first. darcs-hash:20081005001804-23c07-ae429620b924fb5d9ef28f3356f59866326da7d6 --- XMonad/Operations.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'XMonad/Operations.hs') 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 -- cgit v1.2.3