Alt-tab strange behavior

Hi, I’ve been creating a client for my robot AI using SDL.
The client contains texture-target buttons, they behave exactly like I want them to until I alt tab.
They switch location with eachother, which is impossible as far as my code is programmed to do.
There is one animated button, which after alt tab renders back to its original location when the mouse hovers over it.
The non-target main texture retains its original location after alt tab.

I’ve been looking around the internet and can’t find anything except doing proper alt tab handling, on which no proper info is available.

Edit: removed the application, problem solved by website below

I’ve come a bit further in finding that render-targeted textures get reset after alt tab, and need to be reloaded. This does explain why the animated button gets rendered back correctly when it re-renders.

It’s a pretty inconvenient issue though.