ViewPrivate::contextMenu() has a surprising way of handling the ktexteditor_popup menu aboutToXXX signals: it disconnects them from the current ViewPrivate instance and then reconnects them to the same instance.
I think the disconnect should be from all receivers that were once connected to the menu show & hide signals. Doing that resolves the issue where ViewPrivate::aboutToShowContextMenu() is called for all open KTextEditorViews that once had the context menu open, instead of only for the view that is currently active.
BUG: 401069