mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-19 06:03:47 -07:00
Rewrite minimization-related modules
* Use global state instead of per-layout - so now window is minimized on all workspaces (EWMH requires that windows with _NET_WM_STATE_HIDDEN set should be minimized on any workspace but previously they were not) * Use `windows` instead of `modify`. That should fix bugs related to actions that should be done by `windows` and not done by `modify` (fixes #46) * Mark module X.H.RestoreMinimized as deprecated
This commit is contained in:
@@ -23,7 +23,7 @@ import Data.Monoid
|
||||
import Control.Monad(when)
|
||||
|
||||
import XMonad
|
||||
import XMonad.Layout.Minimize
|
||||
import XMonad.Actions.Minimize
|
||||
|
||||
-- $usage
|
||||
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
|
||||
@@ -43,10 +43,10 @@ minimizeEventHook (ClientMessageEvent {ev_window = w,
|
||||
a_aw <- getAtom "_NET_ACTIVE_WINDOW"
|
||||
a_cs <- getAtom "WM_CHANGE_STATE"
|
||||
|
||||
when (mt == a_aw) $ sendMessage (RestoreMinimizedWin w)
|
||||
when (mt == a_aw) $ maximizeWindow w
|
||||
when (mt == a_cs) $ do
|
||||
let message = fromIntegral . head $ dt
|
||||
when (message == normalState) $ sendMessage (RestoreMinimizedWin w)
|
||||
when (message == normalState) $ maximizeWindow w
|
||||
when (message == iconicState) $ minimizeWindow w
|
||||
|
||||
return (All True)
|
||||
|
Reference in New Issue
Block a user