Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
63a00aec
Commit
63a00aec
authored
Apr 10, 2020
by
Thakee Nathees
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display server window position bug fix (#37323)
parent
4f5ad073
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
display_server_x11.cpp
platform/linuxbsd/display_server_x11.cpp
+4
-2
display_server_osx.mm
platform/osx/display_server_osx.mm
+4
-1
display_server_windows.cpp
platform/windows/display_server_windows.cpp
+4
-1
No files found.
platform/linuxbsd/display_server_x11.cpp
View file @
63a00aec
...
...
@@ -3603,8 +3603,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
);
...
...
platform/osx/display_server_osx.mm
View file @
63a00aec
...
...
@@ -3524,7 +3524,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);
...
...
platform/windows/display_server_windows.cpp
View file @
63a00aec
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment