Use glfwGetMonitorWorkarea for accurate screen size#7469
Open
dannyboy0103 wants to merge 3 commits intoisl-org:mainfrom
Open
Use glfwGetMonitorWorkarea for accurate screen size#7469dannyboy0103 wants to merge 3 commits intoisl-org:mainfrom
dannyboy0103 wants to merge 3 commits intoisl-org:mainfrom
Conversation
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
Replace glfwGetVideoMode with glfwGetMonitorWorkarea in GLFWWindowSystem::GetScreenSize(). Since Open3D already bundles GLFW 3.4, we can now use glfwGetMonitorWorkarea() which returns the usable work area (excluding taskbar, dock, and menu bar) instead of the full monitor resolution. This also removes the unusable_height estimation hack in Window::OnResize() that guessed the menu bar and dock height as 4 * font_size. The work area returned by glfwGetMonitorWorkarea() already excludes these regions, making the estimation unnecessary and the auto-sizing more accurate across all platforms.
a14ad9c to
fae8898
Compare
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.
Replace
glfwGetVideoMode()withglfwGetMonitorWorkarea()inGLFWWindowSystem::GetScreenSize()as noted in the existing TODO comment. This also removes theunusable_heightestimation hack (4 * font_size) inWindow::OnResize()since the work area already excludes menu bar, dock, and taskbar.glfwGetVideoMode()returns the full monitor resolution including non-usable areas, which forced a rough estimate for unusable height. Since Open3D already bundles GLFW 3.4,glfwGetMonitorWorkarea()can now provide the exact usable area directly from the OS, making window auto-sizing and centering more accurate across all platforms.