stereo's picture

Window size is incorrect on Mac OS X

Project:The Open Toolkit library
Category:bug report

Window size is incorrect on Mac OS X
In the attached example window size should be 800x600 (displayed on Windows and Linux) but is 800x622 (displayed on Mac OS X).

TestOpenTK.zip8.55 KB


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kanato's picture


Assigned to:Anonymous» kanato

The size of the window is actually correct. The 800x600 that is specified is the client area of the window, and on the Mac this will be 800x600 same as Windows or Linux. I'm guessing that what is actually incorrect is the value reported by the Height property, which is probably reporting the actual height of the window (title bar included) but it should report just the client height. I will look closer at this tomorrow.

kanato's picture


Status:open» fixed

This is fixed in the trunk in rev. 2577 and back ported to the 1.0 branch in 2578.

But I noticed this comment in your source code on the OnResize method: "There is no need to call the base implementation." Where did this come from? It is incorrect. For correct behavior on Mac OS X, the method aglUpdateContext must be called when a window is resized. This can be accomplished either by directly calling Update on the context, or calling the GameWindows OnResize method. If this comment came from an OpenTK example, it needs to be updated.

the Fiddler's picture


Version:1.x-dev» 1.0-beta-3
Status:fixed» closed

Closing issues fixed in opentk-1.0-beta-3.