[xmonad] scratchpads broken after upgrade.

Tony Zorman soliditsallgood at mailbox.org
Sat Oct 22 05:09:57 UTC 2022


Hi Eric,

the problem is the following line:

> myScratchpadManageHook =
>     manageScratchPad <+>
>     namedScratchpadManageHook scratchpads

As Brandon said, the X.U.Scratchpad module is deprecated at this point
(and should have been for 0.17.1 but we didn't notice this in time...).
If you remove your usage of it, everything should work fine.

If you're interested in the boring explanation: what happens in the
background is that X.U.Scratchpad just latches onto X.U.NamedScratchpad
(NSP) functionality, so `scratchpadManageHook' is really just a call to
`namedScratchpadManageHook' with a custom query (which is one of the
reasons we deprecated it).

Now, in order to make NSP more extensible, we shuffled some internals
around and made the scratchpad functions ignore the scratchpad argument
they are given, instead referring to some that *that is filled by the
NSP manageHook*.  This is a bit of a hack, but was necessary to
facilitate backwards compatibility—it is one of the most used modules.
However, since the manageHook runs quite often, we don't want to fill up
the state every time, so there's a small check whether *something* is
there already.  Now, the `(<+>)' operator (which is really `(<>)')
associates to the left, so when running the code `manageScratchPad' will
be executed first, fill up the state with a single unnamed scratchpad,
and call it a day.

Best,
  Tony

-- 
Tony Zorman | https://tony-zorman.com/


More information about the xmonad mailing list