Fix bug for highdpi calculation in Viewer.cpp#2386
Merged
alecjacobson merged 1 commit intolibigl:mainfrom Feb 18, 2025
DJAntivenom:bug_fix/viewer_high_dpi
Merged
Fix bug for highdpi calculation in Viewer.cpp#2386alecjacobson merged 1 commit intolibigl:mainfrom DJAntivenom:bug_fix/viewer_high_dpi
alecjacobson merged 1 commit intolibigl:mainfrom
DJAntivenom:bug_fix/viewer_high_dpi
Conversation
The way the highdpi value was calculated could lead to it being set to 0 or inf for certain types of window managers. (Tiling window managers). This was caused by it trying to resize the window to a width and height of 0x0, or by having the logical width/height of the window be smaller than the pyhsical one. This would cause the `highdpi` variable to be set to 0, which would later cause a glfw call to be made with `inf` as an argument.
Contributor
Author
|
@alecjacobson Hi there, sorry for bothering. Do you think you could have a look at this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
Viewer.cppthe way thehighdpivalue was calculated could lead to it being set to 0 orinffor certain types of window managers. (Tiling window managers). This was caused by the WM trying to resize the window to a width and height of 0 by 0, or by having the logical width/height of the window be smaller than the pyhsical one. This would later cause a glfw call to be made withinfas an argument, which causes an assertion to be raised in debug mode.Fixes (no issue exists).
Viewer::launch_init(...)method to check that we don't divide by 0.ints would be used for a division, which would cause the value to be 0 instead ofChecklist