Merge pull request #37802 from ThakeeNathees/window-position-bug-osx-x11
display server window position bug fix
This commit is contained in:
commit
7e1e0f496b
3 changed files with 12 additions and 4 deletions
|
@ -3606,8 +3606,10 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
|
|||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
WindowID main_window = _create_window(p_mode, p_flags, Rect2i(Point2(), p_resolution));
|
||||
Point2i window_position(
|
||||
(screen_get_size(0).width - p_resolution.width) / 2,
|
||||
(screen_get_size(0).height - p_resolution.height) / 2);
|
||||
WindowID main_window = _create_window(p_mode, p_flags, Rect2i(window_position, p_resolution));
|
||||
for (int i = 0; i < WINDOW_FLAG_MAX; i++) {
|
||||
if (p_flags & (1 << i)) {
|
||||
window_set_flag(WindowFlags(i), true, main_window);
|
||||
|
|
|
@ -3528,7 +3528,10 @@ DisplayServerOSX::DisplayServerOSX(const String &p_rendering_driver, WindowMode
|
|||
}
|
||||
#endif
|
||||
|
||||
WindowID main_window = _create_window(p_mode, Rect2i(Point2i(), p_resolution));
|
||||
Point2i window_position(
|
||||
(screen_get_size(0).width - p_resolution.width) / 2,
|
||||
(screen_get_size(0).height - p_resolution.height) / 2);
|
||||
WindowID main_window = _create_window(p_mode, Rect2i(window_position, p_resolution));
|
||||
for (int i = 0; i < WINDOW_FLAG_MAX; i++) {
|
||||
if (p_flags & (1 << i)) {
|
||||
window_set_flag(WindowFlags(i), true, main_window);
|
||||
|
|
|
@ -2897,7 +2897,10 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
|
|||
}
|
||||
}
|
||||
#endif
|
||||
WindowID main_window = _create_window(p_mode, 0, Rect2i(Point2i(), p_resolution));
|
||||
Point2i window_position(
|
||||
(screen_get_size(0).width - p_resolution.width) / 2,
|
||||
(screen_get_size(0).height - p_resolution.height) / 2);
|
||||
WindowID main_window = _create_window(p_mode, 0, Rect2i(window_position, p_resolution));
|
||||
for (int i = 0; i < WINDOW_FLAG_MAX; i++) {
|
||||
if (p_flags & (1 << i)) {
|
||||
window_set_flag(WindowFlags(i), true, main_window);
|
||||
|
|
Loading…
Reference in a new issue