Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport: Fix setting window size on macos (glfw). #2767

Merged

Conversation

rokups
Copy link
Contributor

@rokups rokups commented Aug 29, 2019

MacOS positions windows by their bottom-left corner why the rest of the world (including imgui) position windows by the top-left corner. This created an issue where collapsing imgui window would cause window header to remain at the bottom the full window rect. Likewise resizing window by using sizing handle caused window to grow upwards when we tried to expand window downwards.

This workaround moves window to the opposite direction by the delta of size change creating an illusion that windows are positioned by their top-left corner.

MacOS positions windows by their bottom-left corner why the rest of the world (including imgui) position windows by the top-left corner. This created an issue where collapsing imgui window would cause window header to remain at the bottom the full window rect. Likewise resizing window by using sizing handle caused window to grow upwards when we tried to expand window downwards.

This workaround moves window to the opposite direction by the delta of size change creating an illusion that windows are positioned by their top-left corner.
@rokups rokups force-pushed the viewport-fix-macos-glfw-set-window-size branch from f613896 to 846cbd4 Compare August 29, 2019 10:54
@ocornut
Copy link
Owner

ocornut commented Aug 29, 2019

Thanks Rokas, much appreciated!
Merging now. Also linking to #2117
Afaik this seemingly is a bug in GLFW (if they expose position at upper-left, the effect size should be exposed as such) would you mind opening an issue on GLFW and see what they say?

@ocornut ocornut merged commit 09780b8 into ocornut:docking Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants