OnFrameResize() handler doesn't get passed the same values on macOS and Windows #17

Closed
opened 2023-07-07 15:17:34 +00:00 by MartinFouilleul · 2 comments
Collaborator

MP_EVENT_WINDOW_RESIZE event gets passed the window's contents rect on macos, but the window's frame (including title bar) on windows.
We can get either using mp_window_get_frame() or mp_window_get_content_rect(), but which one should the event itself contain?
Also, should the wasm apps be aware of their window frame, or only of their drawable contents rect?

`MP_EVENT_WINDOW_RESIZE` event gets passed the window's contents rect on macos, but the window's _frame_ (including title bar) on windows. We can get either using `mp_window_get_frame()` or `mp_window_get_content_rect()`, but which one should the event itself contain? Also, should the wasm apps be aware of their window frame, or only of their drawable contents rect?
Owner

Browsers allow you to query both the "inner" and "outer" sizes of the window, and I think it would be fine for us to support both. That said, I think the size of the content area is far more important.

Browsers allow you to query both the ["inner"](https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight) and ["outer"](https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight) sizes of the window, and I think it would be fine for us to support both. That said, I think the size of the content area is far more important.
bvisness added this to the Jam MVP milestone 2023-07-09 14:46:58 +00:00
Author
Collaborator

Fixed by 23f0d75e20. OnFrameResize() now receives the window contents dimensions on both platforms.

Fixed by 23f0d75e20. `OnFrameResize()` now receives the window _contents_ dimensions on both platforms.
Sign in to join this conversation.
No Label
macOS
windows
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: hmn/orca#17
No description provided.