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
7e1e0f49
Unverified
Commit
7e1e0f49
authored
Apr 29, 2020
by
Rémi Verschelde
Committed by
GitHub
Apr 29, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #37802 from ThakeeNathees/window-position-bug-osx-x11
display server window position bug fix
parents
e23bd5a1
63a00aec
Show 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 @
7e1e0f49
...
...
@@ -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
);
...
...
platform/osx/display_server_osx.mm
View file @
7e1e0f49
...
...
@@ -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);
...
...
platform/windows/display_server_windows.cpp
View file @
7e1e0f49
...
...
@@ -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