[DisplayServer] Use screen "usable rect" instead of full rect to calculate initial window rect.
This commit is contained in:
parent
d76c1d0e51
commit
b02cf351f3
|
@ -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));
|
||||
|
|
|
@ -4563,7 +4563,8 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM
|
|||
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));
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue