mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-02 13:11:53 -07:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bb13853929 | ||
|
3d1720c3f3 | ||
|
0614ffb65c | ||
|
85b47fc3ac | ||
|
1a99280227 | ||
|
e8133eb9a6 |
15
CHANGES.md
15
CHANGES.md
@@ -2,6 +2,21 @@
|
|||||||
|
|
||||||
## unknown (unknown)
|
## unknown (unknown)
|
||||||
|
|
||||||
|
## 0.15 (September 30, 2018)
|
||||||
|
|
||||||
|
* Reimplement `sendMessage` to deal properly with windowset changes made
|
||||||
|
during handling.
|
||||||
|
|
||||||
|
* Add new library functions `windowBracket` and `modifyWindowSet` to
|
||||||
|
`XMonad.Operations`.
|
||||||
|
|
||||||
|
## 0.14.2 (August 21, 2018)
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Add the sample configuration file xmonad.hs again to the release tarball.
|
||||||
|
[https://github.com/xmonad/xmonad/issues/181]
|
||||||
|
|
||||||
## 0.14.1 (August 20, 2018)
|
## 0.14.1 (August 20, 2018)
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
.\" Automatically generated by Pandoc 2.2.1
|
.\" Automatically generated by Pandoc 2.2.1
|
||||||
.\"
|
.\"
|
||||||
.TH "XMONAD" "1" "20 August 2018" "Tiling Window Manager" ""
|
.TH "XMONAD" "1" "30 September 2018" "Tiling Window Manager" ""
|
||||||
.hy
|
.hy
|
||||||
.SH Name
|
.SH Name
|
||||||
.PP
|
.PP
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
<meta name="generator" content="pandoc" />
|
<meta name="generator" content="pandoc" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||||
<meta name="author" content="" />
|
<meta name="author" content="" />
|
||||||
<meta name="dcterms.date" content="2018-08-20" />
|
<meta name="dcterms.date" content="2018-09-30" />
|
||||||
<title>XMONAD(1) Tiling Window Manager</title>
|
<title>XMONAD(1) Tiling Window Manager</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
code{white-space: pre-wrap;}
|
code{white-space: pre-wrap;}
|
||||||
@@ -84,7 +84,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
|
|||||||
<header>
|
<header>
|
||||||
<h1 class="title">XMONAD(1) Tiling Window Manager</h1>
|
<h1 class="title">XMONAD(1) Tiling Window Manager</h1>
|
||||||
<p class="author"></p>
|
<p class="author"></p>
|
||||||
<p class="date">20 August 2018</p>
|
<p class="date">30 September 2018</p>
|
||||||
</header>
|
</header>
|
||||||
<nav id="TOC">
|
<nav id="TOC">
|
||||||
<ul>
|
<ul>
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
% XMONAD(1) Tiling Window Manager
|
% XMONAD(1) Tiling Window Manager
|
||||||
%
|
%
|
||||||
% 20 August 2018
|
% 30 September 2018
|
||||||
|
|
||||||
# Name
|
# Name
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ import XMonad.Layout (Full(..))
|
|||||||
import qualified XMonad.StackSet as W
|
import qualified XMonad.StackSet as W
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
import Data.Monoid (Endo(..))
|
import Data.Monoid (Endo(..),Any(..))
|
||||||
import Data.List (nub, (\\), find)
|
import Data.List (nub, (\\), find)
|
||||||
import Data.Bits ((.|.), (.&.), complement, testBit)
|
import Data.Bits ((.|.), (.&.), complement, testBit)
|
||||||
import Data.Ratio
|
import Data.Ratio
|
||||||
@@ -30,6 +30,7 @@ import qualified Data.Set as S
|
|||||||
|
|
||||||
import Control.Applicative((<$>), (<*>))
|
import Control.Applicative((<$>), (<*>))
|
||||||
import Control.Arrow (second)
|
import Control.Arrow (second)
|
||||||
|
import Control.Monad (void)
|
||||||
import Control.Monad.Reader
|
import Control.Monad.Reader
|
||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
import qualified Control.Exception.Extensible as C
|
import qualified Control.Exception.Extensible as C
|
||||||
@@ -176,6 +177,25 @@ windows f = do
|
|||||||
unless isMouseFocused $ clearEvents enterWindowMask
|
unless isMouseFocused $ clearEvents enterWindowMask
|
||||||
asks (logHook . config) >>= userCodeDef ()
|
asks (logHook . config) >>= userCodeDef ()
|
||||||
|
|
||||||
|
-- | Modify the @WindowSet@ in state with no special handling.
|
||||||
|
modifyWindowSet :: (WindowSet -> WindowSet) -> X ()
|
||||||
|
modifyWindowSet f = modify $ \xst -> xst { windowset = f (windowset xst) }
|
||||||
|
|
||||||
|
-- | Perform an @X@ action and check its return value against a predicate p.
|
||||||
|
-- If p holds, unwind changes to the @WindowSet@ and replay them using @windows@.
|
||||||
|
windowBracket :: (a -> Bool) -> X a -> X a
|
||||||
|
windowBracket p action = withWindowSet $ \old -> do
|
||||||
|
a <- action
|
||||||
|
when (p a) . withWindowSet $ \new -> do
|
||||||
|
modifyWindowSet $ \_ -> old
|
||||||
|
windows $ \_ -> new
|
||||||
|
return a
|
||||||
|
|
||||||
|
-- | A version of @windowBracket@ that discards the return value, and handles an
|
||||||
|
-- @X@ action reporting its need for refresh via @Any@.
|
||||||
|
windowBracket_ :: X Any -> X ()
|
||||||
|
windowBracket_ = void . windowBracket getAny
|
||||||
|
|
||||||
-- | Produce the actual rectangle from a screen and a ratio on that screen.
|
-- | Produce the actual rectangle from a screen and a ratio on that screen.
|
||||||
scaleRationalRect :: Rectangle -> W.RationalRect -> Rectangle
|
scaleRationalRect :: Rectangle -> W.RationalRect -> Rectangle
|
||||||
scaleRationalRect (Rectangle sx sy sw sh) (W.RationalRect rx ry rw rh)
|
scaleRationalRect (Rectangle sx sy sw sh) (W.RationalRect rx ry rw rh)
|
||||||
@@ -371,15 +391,16 @@ setFocusX w = withWindowSet $ \ws -> do
|
|||||||
-- Message handling
|
-- Message handling
|
||||||
|
|
||||||
-- | Throw a message to the current 'LayoutClass' possibly modifying how we
|
-- | Throw a message to the current 'LayoutClass' possibly modifying how we
|
||||||
-- layout the windows, then refresh.
|
-- layout the windows, in which case changes are handled through a refresh.
|
||||||
sendMessage :: Message a => a -> X ()
|
sendMessage :: Message a => a -> X ()
|
||||||
sendMessage a = do
|
sendMessage a = windowBracket_ $ do
|
||||||
w <- W.workspace . W.current <$> gets windowset
|
w <- W.workspace . W.current <$> gets windowset
|
||||||
ml' <- handleMessage (W.layout w) (SomeMessage a) `catchX` return Nothing
|
ml' <- handleMessage (W.layout w) (SomeMessage a) `catchX` return Nothing
|
||||||
whenJust ml' $ \l' ->
|
whenJust ml' $ \l' ->
|
||||||
windows $ \ws -> ws { W.current = (W.current ws)
|
modifyWindowSet $ \ws -> ws { W.current = (W.current ws)
|
||||||
{ W.workspace = (W.workspace $ W.current ws)
|
{ W.workspace = (W.workspace $ W.current ws)
|
||||||
{ W.layout = l' }}}
|
{ W.layout = l' }}}
|
||||||
|
return (Any $ isJust ml')
|
||||||
|
|
||||||
-- | Send a message to all layouts, without refreshing.
|
-- | Send a message to all layouts, without refreshing.
|
||||||
broadcastMessage :: Message a => a -> X ()
|
broadcastMessage :: Message a => a -> X ()
|
||||||
|
@@ -18,7 +18,7 @@ prop_delete x =
|
|||||||
where _ = x :: T
|
where _ = x :: T
|
||||||
|
|
||||||
-- delete is reversible with 'insert'.
|
-- delete is reversible with 'insert'.
|
||||||
-- It is the identiy, except for the 'master', which is reset on insert and delete.
|
-- It is the identity, except for the 'master', which is reset on insert and delete.
|
||||||
--
|
--
|
||||||
prop_delete_insert (x :: T) =
|
prop_delete_insert (x :: T) =
|
||||||
case peek x of
|
case peek x of
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
name: xmonad
|
name: xmonad
|
||||||
version: 0.14.2
|
version: 0.15
|
||||||
synopsis: A tiling window manager
|
synopsis: A tiling window manager
|
||||||
description: xmonad is a tiling window manager for X. Windows are arranged
|
description: xmonad is a tiling window manager for X. Windows are arranged
|
||||||
automatically to tile the screen without gaps or overlap, maximising
|
automatically to tile the screen without gaps or overlap, maximising
|
||||||
|
Reference in New Issue
Block a user