Resize X11 resolution (XF86_VM extension)

I have one question. If I resize the X11 resolution with

XF86VidModeSwitchToMode(OGL_dpy, XDefaultScreen(OGL_dpy), vm_modelines[nr]);

(and setting the viewport to (0,0) with
XF86VidModeSetViewPort(OGL_dpy, scrnum, 0, 0):wink:

how can I set the viewport to the upper left position of the content of a
window ? I only can set the viewport to the upper left position of the
windowmanager border of the window…

thanks,
-Andre.

I have one question. If I resize the X11 resolution with

XF86VidModeSwitchToMode(OGL_dpy, XDefaultScreen(OGL_dpy), vm_modelines[nr]);

(and setting the viewport to (0,0) with
XF86VidModeSetViewPort(OGL_dpy, scrnum, 0, 0):wink:

how can I set the viewport to the upper left position of the content of a
window ? I only can set the viewport to the upper left position of the
windowmanager border of the window…

If you use SDL, it’s all taken care of for you.

If you are not using SDL, it’s very tricky. - Actually it’s a bit tricky
inside SDL too, you just don’t need to worry about it. SDL removes the
titlebar, puts the window at (0,0), and throws the mouse into the corner
to move the viewport (working around a bug in XF86VidModeSetViewPort())

Setting a fullscreen OpenGL mode does have the desired effect:
SDL_SetVideoMode(WIDTH, HEIGHT, 0, SDL_OPENGL|SDL_FULLSCREEN);

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec