Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
X.H.ManageDocks: Init strut cache on demand if necessary
This makes docksStartupHook unnecessary. That is desirable because we didn't add a changelog entry about it being necessary, and 4 years after its introduction we still have users grabbing old configs and reporting (xmonad/xmonad#21 (comment)) that ManageDocks doesn't work properly. I would love to finally settle this. Full story follows: xmonad-contrib 0.12 introduced (00be056, merged in April 2013) caching to ManageDocks to avoid queryTree calls on every runLayout, which brought in several bugs. Attempts to fix these bugs in xmonad-contrib 0.13 introduced (28e9f8b, merged in February 2016) a breaking change in ManageDocks that required users to add docksStartupHook (or docks, after e38fb3b got merged in November 2016) to their configs for avoidStruts to still work after xmonad restart. Unfortunately this was never mentioned in the changelog nor in any compilation warning (which get discarded by xmonad --recompile anyway !!!), so as of March 2020 we still have users being bitten by this. Back in September 2016 in a discussion about other bugs introduced in 28e9f8b I suggested that we use Maybe to indicate whether the cache had been initialized and initialize it on demand when it had not. Unfortunately I wasn't sufficiently clear about what I meant and Brandon was going through some health issues, so we just got into a heated argument and ended up merging a suboptimal solution. :-( And since we're _still_ getting complaints from users every now and then, I believe it's worth dealing with even after all these years. If nothing else, let this serve as a reminder that breaking users' configs without any warning is wrong. (Oh and we should probably stop hiding xmonad.hs compilation warnings, otherwise we can't ever hope to provide smooth deprecation and upgrade paths.) Fixes: 00be056 ("Cache results from calcGap in ManageDocks") Fixes: 28e9f8b ("add docksStartupHook for handling docks when restarted") Fixes: e38fb3b ("Make usage of ManageDocks simpler and more robust") Related: xmonad#118 Related: xmonad#30 Related: xmonad#80 Related: xmonad/xmonad#21
- Loading branch information