Closing some programs cause keystrokes to follow mouse

If I open two mate-terminals then launch wish (from the tk8.6 package) from one of the terminals and just close the new wish window with my mouse and leave the mouse over the desktop then my typing will not go to the terminal I launched wish from as expected. If I mouse over one terminal and type then the typing will go there. The same if I then mouse over the other terminal. This continues until I click on one of the terminals to give it complete focus.

I don't have focus follows mouse on, but it is almost like it is switching to focus follows mouse after closing the wish window. However, the terminals don't look like they get full focus on mouse over, they just start capturing keystrokes.

The same happens if I launch xterm from one of the mate-terminals. However, if run mate-terminal in one of the terminals, when I close the third terminal the terminal I launched it from gets full focus back (like I would expect) and moving the mouse over windows doesn't have any affect (as expected).

I am running 22.04.2 LTS (Jammy Jellyfish) 64-bit.
I'm not sure if this is a bug or a known incompatibility or what. Can anyone else recreate this?

1 Like

Welcome @loyal to the community!