Skip to content

Use glfwGetMonitorWorkarea for accurate screen size#7469

Open
dannyboy0103 wants to merge 3 commits intoisl-org:mainfrom
dannyboy0103:use-glfwGetMonitorWorkarea
Open

Use glfwGetMonitorWorkarea for accurate screen size#7469
dannyboy0103 wants to merge 3 commits intoisl-org:mainfrom
dannyboy0103:use-glfwGetMonitorWorkarea

Conversation

@dannyboy0103
Copy link
Copy Markdown

Replace glfwGetVideoMode() with glfwGetMonitorWorkarea() in GLFWWindowSystem::GetScreenSize() as noted in the existing TODO comment. This also removes the unusable_height estimation hack (4 * font_size) in Window::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.

@update-docs
Copy link
Copy Markdown

update-docs bot commented Mar 26, 2026

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.
@dannyboy0103 dannyboy0103 force-pushed the use-glfwGetMonitorWorkarea branch from a14ad9c to fae8898 Compare March 26, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant