Desktopwidth is nearly a direct call to glutget(), and to be honest, I don’t know if this is the expected behavior or not.
The documentation is very barebones:
https://www.opengl.org/resources/libraries/glut/spec3/node70.htmlGLUT_SCREEN_WIDTH
Width of the screen in pixels. Zero indicates the width is unknown or not available.
GLUT_SCREEN_HEIGHT
Height of the screen in pixels. Zero indicates the height is unknown or not available.
************
Now, whether that Width/Height is only calculated once at program start-up, or on the fly as needed, I honestly don’t know.
If your program requires detections for this type of thing, you may need to resort to using declare library with the windows api (or Linux/Mac equivalent).