Most of the time when I'm working, I have 4 windows open (editor, browser, mail client, terminal), and I use the multiple virtual desktops feature to put one on each window. So instead of alt-tabbing, I move to a different desktop.
The issue is that when I have them arranged on the desktops correctly and then disconnect my external monitor, they're all moved to the same desktop. When I plug the external monitor back in, then some of them are moved to the external, whereas some are still on the laptop display. Either way, it makes being mobile a very jarring experience.
Is there some way to "fix" or configure this behaviour?