It currently works if "Desktop" is set to the size the display is changed to or if Managed=N.
Well, I just have one problem with this patch : you call XGrabPointer in your code :
+ TSXGrabPointer(thread_display(), window, True, 0, GrabModeAsync, GrabModeAsync, window, None, CurrentTime);
That means that, after this, only this particular thread will receive any mouse inputs. Ie if your application has one thread doing a resolution change and another doing the mouse input, you will break it (at least this is my understanding of the whole 'thread_display' 'mess' :-) ).
So to really have a desktop full screen option working (I was working on it some times ago), you would need :
1) either a 'grabless' window retriction X extension (ie say to X that you want the mouse to be restricted to one particular window but to still send events to all the connections)
2) do what I was trying to do : have an X extension to 'lock' the viewport after having done a resolution change (I started on it, but was a bit stuck on some implementation details). After, you would need, of course, some Window Manager extensions to tell 'hey, from now on, I do not want to switch desktops when going at the edge of the screen'.
This is why DXGrab works, because the grabbing is done in the context of the thread initializating DInput (ie the thread that will do the actual input event handling).
Lionel