I posted this question on the forums at Phoronix but I have gotten nothing there. I'm hoping I might have better luck here.

I have been using Nvidia's twinview with KDE for a long long time. In that time I have always been frustrated by the effect resolution changes have on my window placement. I place my windows in a particular configuration between my two monitors. When I start a game that uses RandR resolution mode changes the placement of my windows ends up changed. In particular the windows get moved to the left monitor if the game switches to a mode that turns the right monitor off. When I'm done playing I have to reposition all my windows. Sometimes the resolution change will also cause my taskbar size to change from around 80% of the width of one monitor to 100%. I have been getting around this issue by using XVidMode resolution mode switching whenever possible. This involves setting registry options for games that use Wine. I also sometimes use GameTreeLinux/Cedega and it uses XVidMode by default. When it comes to native games the chances seem to be about 50/50 that it will use one or the other. libSDL based games will use XVidMode if built against the last few releases or, in the case of games dynamically linked against libSDL, your system libraries are up-to-date. SDL can also be forced to use XVidMode with an environment variable.

As of the 302.XX Nvidia drivers switching resolutions with XVidMode is resulting in the same issue I have when switching with X/Randr. So my "work-around" is no longer working. At this point I am ready to try something else and I am hoping that someone here knows a better solution. I would like for my windows to either return to their original position or for KDE to totally ignore resolution changes. I don't know if the solution might lie in KDE settings, X settings, or Nvidia settings. Thanks for any ideas you might have._________________Gentoo Gaming Videos

kwin used to ignore the monitor/resolution changes, and that was considered a bug (bug 185103). The problem you want to solve is rather special, I cannot think of a reliable way to detect whether the change is temporary or not. And most of time you do not want the window to stay outside the current screen after the monitor/resolution changes. I guess the best solution will be writing your own kwin script to save and restore the window positions manually, maybe add it to the menu to make it a little bit easier to use.

I use metamode to solve that, using metamode you define two mode, one for desktop usage (two monitors), and one for gaming usage (one monitor)
the nvidia driver switch from one to the other when seeing the resolution change query (so when your game load, set the game to that resolution), while your desktop don't see any mode change.
read nvidia metamode explain in the nvidia doc or crawl the forum for sample.

The first one is my desktop mode: 1680x1050,1280x1024. The second one is my usual gaming mode: 1680x1050,NULL. The problem is that when the resolution automatically changes to the second mode the desktop is getting resized. It has been doing that for Xrandr for as long as I can remember but only with the new Nvidia drivers is it doing that with XVidMode. When this resize occurs that is when my windows and stuff get all messed up. Am I doing something wrong or is there an option I need to enable? Thanks._________________Gentoo Gaming Videos