mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-06 06:51:55 -07:00
fix up funny unicode whitespace in Fullscreen
This commit is contained in:
@@ -90,14 +90,14 @@ instance LayoutModifier FullscreenFull Window where
|
|||||||
|
|
||||||
pureModifier (FullscreenFull frect fulls) rect _ list =
|
pureModifier (FullscreenFull frect fulls) rect _ list =
|
||||||
(map (flip (,) rect') visfulls ++ rest, Nothing)
|
(map (flip (,) rect') visfulls ++ rest, Nothing)
|
||||||
where visfulls = intersect fulls $ map fst list
|
where visfulls = intersect fulls $ map fst list
|
||||||
rest = filter (flip notElem visfulls . fst) list
|
rest = filter (flip notElem visfulls . fst) list
|
||||||
rect' = scaleRationalRect rect frect
|
rect' = scaleRationalRect rect frect
|
||||||
|
|
||||||
instance LayoutModifier FullscreenFocus Window where
|
instance LayoutModifier FullscreenFocus Window where
|
||||||
pureMess (FullscreenFocus frect fulls) m = case fromMessage m of
|
pureMess (FullscreenFocus frect fulls) m = case fromMessage m of
|
||||||
Just (AddFullscreen win) -> Just $ FullscreenFocus frect $ nub $ win:fulls
|
Just (AddFullscreen win) -> Just $ FullscreenFocus frect $ nub $ win:fulls
|
||||||
Just (RemoveFullscreen win) -> Just $ FullscreenFocus frect $ delete win $ fulls
|
Just (RemoveFullscreen win) -> Just $ FullscreenFocus frect $ delete win $ fulls
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
pureModifier (FullscreenFocus frect fulls) rect (Just (W.Stack {W.focus = f})) list
|
pureModifier (FullscreenFocus frect fulls) rect (Just (W.Stack {W.focus = f})) list
|
||||||
@@ -110,13 +110,13 @@ instance LayoutModifier FullscreenFocus Window where
|
|||||||
instance LayoutModifier FullscreenFloat Window where
|
instance LayoutModifier FullscreenFloat Window where
|
||||||
handleMess (FullscreenFloat frect fulls) m = case fromMessage m of
|
handleMess (FullscreenFloat frect fulls) m = case fromMessage m of
|
||||||
Just (AddFullscreen win) -> do
|
Just (AddFullscreen win) -> do
|
||||||
mrect <- (M.lookup win . W.floating) `fmap` gets windowset
|
mrect <- (M.lookup win . W.floating) `fmap` gets windowset
|
||||||
return $ case mrect of
|
return $ case mrect of
|
||||||
Just rect -> Just $ FullscreenFloat frect $ M.insert win (rect,True) fulls
|
Just rect -> Just $ FullscreenFloat frect $ M.insert win (rect,True) fulls
|
||||||
Nothing -> Nothing
|
Nothing -> Nothing
|
||||||
|
|
||||||
Just (RemoveFullscreen win) ->
|
Just (RemoveFullscreen win) ->
|
||||||
return $ Just $ FullscreenFloat frect $ M.adjust (second $ const False) win fulls
|
return $ Just $ FullscreenFloat frect $ M.adjust (second $ const False) win fulls
|
||||||
|
|
||||||
-- Modify the floating member of the stack set directly; this is the hackish part.
|
-- Modify the floating member of the stack set directly; this is the hackish part.
|
||||||
Just FullscreenChanged -> do
|
Just FullscreenChanged -> do
|
||||||
@@ -125,7 +125,7 @@ instance LayoutModifier FullscreenFloat Window where
|
|||||||
flt = W.floating ws
|
flt = W.floating ws
|
||||||
flt' = M.intersectionWith doFull fulls flt
|
flt' = M.intersectionWith doFull fulls flt
|
||||||
put state {windowset = ws {W.floating = M.union flt' flt}}
|
put state {windowset = ws {W.floating = M.union flt' flt}}
|
||||||
return $ Just $ FullscreenFloat frect $ M.filter snd fulls
|
return $ Just $ FullscreenFloat frect $ M.filter snd fulls
|
||||||
where doFull (_, True) _ = frect
|
where doFull (_, True) _ = frect
|
||||||
doFull (rect, False) _ = rect
|
doFull (rect, False) _ = rect
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ fullscreenFull = fullscreenFullRect $ W.RationalRect 0 0 1 1
|
|||||||
-- specified rectangle instead of the entire screen.
|
-- specified rectangle instead of the entire screen.
|
||||||
fullscreenFullRect :: LayoutClass l a =>
|
fullscreenFullRect :: LayoutClass l a =>
|
||||||
W.RationalRect -> l a -> ModifiedLayout FullscreenFull l a
|
W.RationalRect -> l a -> ModifiedLayout FullscreenFull l a
|
||||||
fullscreenFullRect r = ModifiedLayout $ FullscreenFull r []
|
fullscreenFullRect r = ModifiedLayout $ FullscreenFull r []
|
||||||
|
|
||||||
-- | Layout modifier that makes the fullscreened window fill
|
-- | Layout modifier that makes the fullscreened window fill
|
||||||
-- the entire screen only if it is currently focused.
|
-- the entire screen only if it is currently focused.
|
||||||
@@ -153,7 +153,7 @@ fullscreenFocus = fullscreenFocusRect $ W.RationalRect 0 0 1 1
|
|||||||
-- specified rectangle instead of the entire screen.
|
-- specified rectangle instead of the entire screen.
|
||||||
fullscreenFocusRect :: LayoutClass l a =>
|
fullscreenFocusRect :: LayoutClass l a =>
|
||||||
W.RationalRect -> l a -> ModifiedLayout FullscreenFocus l a
|
W.RationalRect -> l a -> ModifiedLayout FullscreenFocus l a
|
||||||
fullscreenFocusRect r = ModifiedLayout $ FullscreenFocus r []
|
fullscreenFocusRect r = ModifiedLayout $ FullscreenFocus r []
|
||||||
|
|
||||||
-- | Hackish layout modifier that makes floating fullscreened
|
-- | Hackish layout modifier that makes floating fullscreened
|
||||||
-- windows fill the entire screen.
|
-- windows fill the entire screen.
|
||||||
@@ -165,7 +165,7 @@ fullscreenFloat = fullscreenFloatRect $ W.RationalRect 0 0 1 1
|
|||||||
-- specified rectangle instead of the entire screen.
|
-- specified rectangle instead of the entire screen.
|
||||||
fullscreenFloatRect :: LayoutClass l a =>
|
fullscreenFloatRect :: LayoutClass l a =>
|
||||||
W.RationalRect -> l a -> ModifiedLayout FullscreenFloat l a
|
W.RationalRect -> l a -> ModifiedLayout FullscreenFloat l a
|
||||||
fullscreenFloatRect r = ModifiedLayout $ FullscreenFloat r M.empty
|
fullscreenFloatRect r = ModifiedLayout $ FullscreenFloat r M.empty
|
||||||
|
|
||||||
-- | The event hook required for the layout modifiers to work
|
-- | The event hook required for the layout modifiers to work
|
||||||
fullscreenEventHook :: Event -> X All
|
fullscreenEventHook :: Event -> X All
|
||||||
@@ -188,7 +188,7 @@ fullscreenEventHook (ClientMessageEvent _ _ _ dpy win typ (action:dats)) = do
|
|||||||
sendMessage FullscreenChanged
|
sendMessage FullscreenChanged
|
||||||
when (action == remove || (action == toggle && isFull)) $ do
|
when (action == remove || (action == toggle && isFull)) $ do
|
||||||
chWState $ delete (fi fullsc)
|
chWState $ delete (fi fullsc)
|
||||||
broadcastMessage $ RemoveFullscreen win
|
broadcastMessage $ RemoveFullscreen win
|
||||||
sendMessage FullscreenChanged
|
sendMessage FullscreenChanged
|
||||||
return $ All True
|
return $ All True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user