From 22b579bd14bce40af2c5123e05823c437983f558 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Mon, 29 Mar 2021 16:51:30 +0100 Subject: [PATCH] Drop deprecated migrateState migrateState is only necessary when _live_ upgrading from xmonad 0.12, so I believe we can drop it now. This fixes a compilation warning that we'd otherwise have to suppress. --- src/XMonad/Main.hs | 1 - src/XMonad/Operations.hs | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/src/XMonad/Main.hs b/src/XMonad/Main.hs index 297c20c..39127dc 100644 --- a/src/XMonad/Main.hs +++ b/src/XMonad/Main.hs @@ -68,7 +68,6 @@ xmonad conf = do args <- getArgs case args of - ("--resume": ws : xs : args') -> migrateState dirs ws xs >> launch' args' ["--help"] -> usage ["--recompile"] -> recompile dirs True >>= flip unless exitFailure ["--restart"] -> sendRestart diff --git a/src/XMonad/Operations.hs b/src/XMonad/Operations.hs index e16941a..db0dfc4 100644 --- a/src/XMonad/Operations.hs +++ b/src/XMonad/Operations.hs @@ -36,7 +36,6 @@ import qualified Control.Exception as C import System.IO import System.Directory -import System.FilePath (()) import System.Posix.Process (executeFile) import Graphics.X11.Xlib import Graphics.X11.Xinerama (getScreenInfo) @@ -522,20 +521,6 @@ readStateFile xmc = do readStrict :: Handle -> IO String readStrict h = hGetContents h >>= \s -> length s `seq` return s --- | Migrate state from a previously running xmonad instance that used --- the older @--resume@ technique. -{-# DEPRECATED migrateState "will be removed some point in the future." #-} -migrateState :: (Functor m, MonadIO m) => Dirs -> String -> String -> m () -migrateState Dirs{ dataDir } ws xs = do - io (putStrLn "WARNING: --resume is no longer supported.") - whenJust stateData $ \s -> - catchIO (writeFile (dataDir "xmonad.state") $ show s) - where - stateData = StateFile <$> maybeRead ws <*> maybeRead xs - maybeRead s = case reads s of - [(x, "")] -> Just x - _ -> Nothing - -- | @restart name resume@. Attempt to restart xmonad by executing the program -- @name@. If @resume@ is 'True', restart with the current window state. -- When executing another window manager, @resume@ should be 'False'.