I've recently found ugly problems with the d3d11 renderer in my game engine. I'm using IDXGISwapChain with real fullscreen and I have serious problems getting Alt-Tabbing to work. Switching between windowed and full screen mode works completely fine.
That was easy to do with DX8/DX9, where didn't have to do anything but check for a lost device. Alt-tabbing from fullscreen restored the display mode and everything worked fine. Now with the IDXGISwapChain I can't alt-tab out of a game running in fullscreen properly anymore.
Upon Alt-tabbing the display goes bonkers (e.g. a part of the screen is displayed half offscreen, but also another part in the top left corner (looks like the resolution has changed, and some old graphics are still there in GPU memory). I do not see the desktop at all. Upon clicking anywhere the game is switched to windowed mode, but with the window stripped of all borders (and therefore the client size being not the size I'm expecting). I do not modify the window styles myself (as I did in DX8/DX9), so I suspect IDXGISwapChain. Unfortunately the extra debug output of D3D11 doesn't show any errors.
I've called MakeWindowAssociation with the flag to not affecting anything (not listenen to Alt-Enter or switch modes).
Does anybody have any ideas what I might be doing wrong? Or maybe have a working sample that does windowed and fullscreen toggling with Alt-tabbing working?
Would reacting on WM_ACTIVATEAPP to switch to windowed mode myself be a good solution?