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

[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect. #75489

Merged
merged 1 commit into from Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion platform/linuxbsd/x11/display_server_x11.cpp
Expand Up @@ -6108,7 +6108,8 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
if (p_screen == SCREEN_OF_MAIN_WINDOW) {
p_screen = SCREEN_PRIMARY;
}
window_position = screen_get_position(p_screen) + (screen_get_size(p_screen) - p_resolution) / 2;
Rect2i scr_rect = screen_get_usable_rect(p_screen);
window_position = scr_rect.position + (scr_rect.size - p_resolution) / 2;
}

WindowID main_window = _create_window(p_mode, p_vsync_mode, p_flags, Rect2i(window_position, p_resolution));
Expand Down
3 changes: 2 additions & 1 deletion platform/macos/display_server_macos.mm
Expand Up @@ -4563,7 +4563,8 @@ - (void)popupAction:(id)sender {
if (p_screen == SCREEN_OF_MAIN_WINDOW) {
p_screen = SCREEN_PRIMARY;
}
window_position = screen_get_position(p_screen) + (screen_get_size(p_screen) - p_resolution) / 2;
Rect2i scr_rect = screen_get_usable_rect(p_screen);
window_position = scr_rect.position + (scr_rect.size - p_resolution) / 2;
}

WindowID main_window = _create_window(p_mode, p_vsync_mode, Rect2i(window_position, p_resolution));
Expand Down
3 changes: 2 additions & 1 deletion platform/windows/display_server_windows.cpp
Expand Up @@ -4705,7 +4705,8 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
if (p_screen == SCREEN_OF_MAIN_WINDOW) {
p_screen = SCREEN_PRIMARY;
}
window_position = screen_get_position(p_screen) + (screen_get_size(p_screen) - p_resolution) / 2;
Rect2i scr_rect = screen_get_usable_rect(p_screen);
window_position = scr_rect.position + (scr_rect.size - p_resolution) / 2;
}

WindowID main_window = _create_window(p_mode, p_vsync_mode, p_flags, Rect2i(window_position, p_resolution));
Expand Down