Skip to content

Commit a6a559d

Browse files
committed
Merge branch 'noborders-resetborder' into dotfiles
2 parents ff447b4 + fe826ca commit a6a559d

File tree

3 files changed

+33
-21
lines changed

3 files changed

+33
-21
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20240708
11+
# version: 0.19.20241114
1212
#
13-
# REGENDATA ("0.19.20240708",["github","cabal.project"])
13+
# REGENDATA ("0.19.20241114",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -83,17 +83,30 @@ jobs:
8383
allow-failure: false
8484
fail-fast: false
8585
steps:
86-
- name: apt
86+
- name: apt-get install
8787
run: |
8888
apt-get update
8989
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
90+
apt-get install -y libx11-dev libxext-dev libxft-dev libxinerama-dev libxrandr-dev libxss-dev
91+
- name: Install GHCup
92+
run: |
9093
mkdir -p "$HOME/.ghcup/bin"
9194
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
9295
chmod a+x "$HOME/.ghcup/bin/ghcup"
93-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
96+
- name: Install cabal-install
97+
run: |
9498
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
95-
apt-get update
96-
apt-get install -y libx11-dev libxext-dev libxft-dev libxinerama-dev libxrandr-dev libxss-dev
99+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
100+
- name: Install GHC (GHCup)
101+
if: matrix.setup-method == 'ghcup'
102+
run: |
103+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
104+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
105+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
106+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
107+
echo "HC=$HC" >> "$GITHUB_ENV"
108+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
109+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
97110
env:
98111
HCKIND: ${{ matrix.compilerKind }}
99112
HCNAME: ${{ matrix.compiler }}
@@ -104,21 +117,12 @@ jobs:
104117
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
105118
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
106119
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
107-
HCDIR=/opt/$HCKIND/$HCVER
108-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
109-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
110-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
111-
echo "HC=$HC" >> "$GITHUB_ENV"
112-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
113-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
114-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115120
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
116121
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
117122
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
118123
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
119124
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
120125
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
121-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
122126
env:
123127
HCKIND: ${{ matrix.compilerKind }}
124128
HCNAME: ${{ matrix.compiler }}
@@ -248,8 +252,8 @@ jobs:
248252
rm -f cabal.project.local
249253
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
250254
- name: save cache
251-
uses: actions/cache/save@v4
252255
if: always()
256+
uses: actions/cache/save@v4
253257
with:
254258
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
255259
path: ~/.cabal/store

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
used to avoid flicker and unnecessary workspace reshuffling if multiple
2525
`xrandr` commands are used to reconfigure the display layout.
2626

27+
* `XMonad.Layout.NoBorders`
28+
29+
- It's no longer necessary to use `borderEventHook` to garbage collect
30+
`alwaysHidden`/`neverHidden` lists. The layout listens to
31+
`DestroyWindowEvent` messages instead, which are broadcast to layouts
32+
since xmonad v0.17.0.
33+
2734
## 0.18.1 (August 20, 2024)
2835

2936
### Breaking Changes

XMonad/Layout/NoBorders.hs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,8 @@ data ConfigurableBorder p w = ConfigurableBorder
143143

144144
-- | Only necessary with 'BorderMessage' - remove non-existent windows from the
145145
-- 'alwaysHidden' or 'neverHidden' lists.
146+
{-# DEPRECATED borderEventHook "No longer needed." #-}
146147
borderEventHook :: Event -> X All
147-
borderEventHook DestroyWindowEvent{ ev_window = w } = do
148-
broadcastMessage $ ResetBorder w
149-
return $ All True
150148
borderEventHook _ = return $ All True
151149

152150
instance (Read p, Show p, SetsAmbiguous p) => LayoutModifier (ConfigurableBorder p) Window where
@@ -167,14 +165,17 @@ instance (Read p, Show p, SetsAmbiguous p) => LayoutModifier (ConfigurableBorder
167165
in ConfigurableBorder gh <$> consNewIf ah (not b)
168166
<*> consNewIf nh b
169167
<*> pure ch
170-
| Just (ResetBorder w) <- fromMessage m =
168+
| Just (ResetBorder w) <- fromMessage m = resetBorder w
169+
| Just DestroyWindowEvent { ev_window = w } <- fromMessage m = resetBorder w
170+
| otherwise = Nothing
171+
where
172+
resetBorder w =
171173
let delete' e l = if e `elem` l then (True,delete e l) else (False,l)
172174
(da,ah') = delete' w ah
173175
(dn,nh') = delete' w nh
174176
in if da || dn
175177
then Just cb { alwaysHidden = ah', neverHidden = nh' }
176178
else Nothing
177-
| otherwise = Nothing
178179

179180
-- | SetsAmbiguous allows custom actions to generate lists of windows that
180181
-- should not have borders drawn through 'ConfigurableBorder'

0 commit comments

Comments
 (0)