Under Xorg, glViewport is never called when creating a window if there is no window manager.
A good illustration of this is the "singlebuffer" demo in Mesa which then renders incorrectly on some drivers. This happens because the background rectangle is incorrectly culled. So the backgound is never cleared. Seen on the PowerVR and Nvidia stacks.
This happens because the window manager usually sends a ConfigureNotify XEvent. With no window manager, this never happens.
Here is a proposed patch. It basically sends the client a fake ConfigureNotify event, which then triggers the Reshape mechanism and does the glViewport setup with the default size of the glutCreateWindow call. This fixes the issue with the Mesa demo and doesn't hurt when running under a window manager since the window manager event (the "real" one) is received last. So if the window size differs from the requested size, the new size is taken into account.
Log in to post a comment.