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

Workaround for cases where glfwGetMonitorWorkarea fails #3457

Closed

Conversation

dougbinks
Copy link
Contributor

Due to an issue with GLFW (not yet reported, I am working on that now) on Windows, glfwGetMonitorWorkarea can report a zero size workarea after a monitor change.

The effect of this is to cause all windows with ImGuiWindowFlags_AlwaysAutoResize set to become almost 0 size, and for some Dear ImGui interactions to fail to work properly.

The simple future proof workaround is to detect 0 size workareas and set the size to the video mode size, and the position to the MainPos as per when the function is not available.

@dougbinks
Copy link
Contributor Author

FYI The PR for the GLFW issue is:

glfw/glfw#1761

@ocornut
Copy link
Owner

ocornut commented Sep 7, 2020

Thank you Doug, applied to fix now!
I took the liberty to reformat the patch and make it a little simpler, see aa8e09d
(well, the patch doesn't look simpler but the end result is, there was duplicate code in the #if/#else statement)

@ocornut ocornut closed this Sep 7, 2020
@dougbinks
Copy link
Contributor Author

Thanks for applying this - your changes are pretty much what I'd do in my own code, but I thought it best to keep the intent of the patch clear & contained.

@dougbinks dougbinks deleted the docking_glfw_workarea_fix branch April 14, 2021 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants