Transferring window to receptable doesn't produce a node_remove event for the disappearing receptable
Author: samaingwCreated Sep 4, 2025Updated Sep 4, 2025
When subscribing the node_add and node_remove events, the standard workflow with receptacles (insert them somewhere, transfer a window to it) produces a node_add event but no node_remove event.
I use scripts which rely on having knowledge of leaf nodes currently in the tree. My scripts are messed up with undying receptacles ;)
Relevant pieces of code:
- Adding a receptacle produces a
node_addevent https://github.com/baskerville/bspwm/blob/af3bd8b4351f4478fe0fe3cfd6c09e44cb108b4b/src/tree.c#L464-L473 - Killing receptable produces the
node_removeevent https://github.com/baskerville/bspwm/blob/af3bd8b4351f4478fe0fe3cfd6c09e44cb108b4b/src/tree.c#L1423-L1439 - Replacing a receptacle by a window doesn't produce node_remove events (no put_status in the quoted piece of code) https://github.com/baskerville/bspwm/blob/af3bd8b4351f4478fe0fe3cfd6c09e44cb108b4b/src/tree.c#L311-L324
To make node_add and node_remove consistent, two options:
- receptacles don't report node_add event (the same way as non-leaf nodes) nor node_remove
- receptacles report both node_add and node_remove, as if they were windows
Even though for my own use case I'd rather go with option 1, I think for the community that option 2 is the most logical/unsurprising one.
Thoughts on that ? I can definitely make the PR, I just need to know which PR I should make.
Source: baskerville/bspwm