Mac Mini 2011: Dual Display setup and HDMI Switching I have following setup:

A Mac mini 2011 with two displays - one on HDMI and on in Displayport. The HDMI display is connected to an HDMI Switcher which I use to connect different input devices to the HDMI display, like a RPi. 

Every time I switch the input devices through the switcher away from the Mac mini, macOS deactivates dual display mode - all windows move to the DisplayPort display. When I switch back input to the Mac mini dual display support is re-activated and all windows move back.

Is there any way to change this behavior? I would like to keep dual display mode going on even after switching the display input. Is this possible?
The behavior  you are seeing is because the switch you are using is completely disconnecting the signal from the Mac so macOS assumes (rightly so) that they monitor is gone and it needs to consolidate the windows.

It would be as if you physically removed the cable from the Mac mini and plugged it into your other device.  

To get around this, you need an active device like a KVM (keyboard video mouse switcher) which will maintain the signal(s).  

Though a KVM might be complete overkill if all you really want/need to change video inputs.  What may be the best solution is get a monitor with multiple inputs and you just change it on the monitor itself.