summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Markus Rothe <mrothe@exherbo.org> 2017-04-25 21:36:57 +0200
committerAvatar Markus Rothe <mrothe@exherbo.org> 2017-04-25 21:36:57 +0200
commitdd3a004ea9d9e2d974537d0dc5d67e677e3826b2 (patch)
tree6ad43d3cb471d5ff6fa0cf8ca2cc14249861dd01
parent2afb48a70cc4bd38b8b400dd55d73de62aa47356 (diff)
downloadhaskell-master.tar.gz
haskell-master.tar.xz
xmonad: fix a run time issue, see patch for detailsHEADmaster
-rw-r--r--packages/x11-wm/xmonad/files/89a8cc88c31163dd35d3182bbba7cdd0630ff54b.patch81
-rw-r--r--packages/x11-wm/xmonad/xmonad-0.13-r1.exheres-0 (renamed from packages/x11-wm/xmonad/xmonad-0.13.exheres-0)2
2 files changed, 83 insertions, 0 deletions
diff --git a/packages/x11-wm/xmonad/files/89a8cc88c31163dd35d3182bbba7cdd0630ff54b.patch b/packages/x11-wm/xmonad/files/89a8cc88c31163dd35d3182bbba7cdd0630ff54b.patch
new file mode 100644
index 0000000..8b27fc0
--- /dev/null
+++ b/packages/x11-wm/xmonad/files/89a8cc88c31163dd35d3182bbba7cdd0630ff54b.patch
@@ -0,0 +1,81 @@
+Source: https://github.com/pjones/xmonad/commit/89a8cc88c31163dd35d3182bbba7cdd0630ff54b
+Upstream: https://github.com/xmonad/xmonad/issues/86
+Reason: "my xmonad breaks"
+
+From 89a8cc88c31163dd35d3182bbba7cdd0630ff54b Mon Sep 17 00:00:00 2001
+From: Peter Jones <pjones@devalot.com>
+Date: Thu, 30 Mar 2017 13:42:16 -0700
+Subject: [PATCH] Remove the xmonad state file after reading it
+
+Tries to make sure IO is not lazy so the file is processed before it
+is removed from the file system.
+
+Fixes #86 and friends.
+---
+ CHANGES.md | 14 ++++++++++++++
+ src/XMonad/Operations.hs | 16 +++++++++++++---
+ 2 files changed, 27 insertions(+), 3 deletions(-)
+
+diff --git a/CHANGES.md b/CHANGES.md
+index fed3bc9..ebb104f 100644
+--- a/CHANGES.md
++++ b/CHANGES.md
+@@ -1,5 +1,19 @@
+ # Change Log / Release Notes
+
++## 0.14 (Not Yet Released)
++
++### Bug Fixes
++
++ * The state file that xmonad uses while restarting itself is now
++ removed after it is processed. This fixes a bug that manifested
++ in several different ways:
++
++ - Names of old workspaces would be resurrected after a restart
++ - Screen sizes would be wrong after changing monitor configuration (#90)
++ - `spawnOnce` stopped working (xmonad/xmonad-contrib#155)
++ - Focus did not follow when moving between workspaces (#87)
++ - etc.
++
+ ## 0.13 (February 10, 2017)
+
+ ### Breaking Changes
+diff --git a/src/XMonad/Operations.hs b/src/XMonad/Operations.hs
+index 4b46571..7dbb45c 100644
+--- a/src/XMonad/Operations.hs
++++ b/src/XMonad/Operations.hs
+@@ -465,14 +465,21 @@ writeStateToFile = do
+ catchIO (writeFile path $ show stateData)
+
+ -- | Read the state of a previous xmonad instance from a file and
+--- return that state.
++-- return that state. The state file is removed after reading it.
+ readStateFile :: (LayoutClass l Window, Read (l Window)) => XConfig l -> X (Maybe XState)
+ readStateFile xmc = do
+ path <- stateFileName
+- raw <- userCode $ io (readFile path)
++
++ -- I'm trying really hard here to make sure we read the entire
++ -- contents of the file before it is removed from the file system.
++ sf' <- userCode . io $ do
++ raw <- withFile path ReadMode readStrict
++ return $! maybeRead reads raw
++
++ io (removeFile path)
+
+ return $ do
+- sf <- maybeRead reads =<< raw
++ sf <- join sf'
+
+ let winset = W.ensureTags layout (workspaces xmc) $ W.mapLayout (fromMaybe layout . maybeRead lreads) (sfWins sf)
+ extState = M.fromList . map (second Left) $ sfExt sf
+@@ -491,6 +498,9 @@ readStateFile xmc = do
+ [(x, "")] -> Just x
+ _ -> Nothing
+
++ 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." #-}
diff --git a/packages/x11-wm/xmonad/xmonad-0.13.exheres-0 b/packages/x11-wm/xmonad/xmonad-0.13-r1.exheres-0
index 71ecc69..4d67c50 100644
--- a/packages/x11-wm/xmonad/xmonad-0.13.exheres-0
+++ b/packages/x11-wm/xmonad/xmonad-0.13-r1.exheres-0
@@ -93,3 +93,5 @@ pkg_postinst() {
elog "x11-plugins/xmonad-contrib package to be installed."
}
+DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/89a8cc88c31163dd35d3182bbba7cdd0630ff54b.patch )
+