In the case of (at least the original) dx7 driver, the graphics context was setup as a single backbuffer the size of the primary desktop screen shared by all canvas, so in theory this is what should be being reported back as the SetViewPort command is of course useful for rendering back into images (grabpixmap instead of flip) not just to attached canvas gadgets.
I don't know about OpenGL, please post some code.
I don't know about OpenGL, please post some code.