diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-09-03 00:09:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-03 00:09:19 +0200 |
commit | 2a8531cc56a7110f8248f18b8248fb1ed346c872 (patch) | |
tree | 294b5fc416158e335986369970bf4ae7aeb1ee8d /platform/osx/display_server_osx.mm | |
parent | 7cc1e2062a996fea4005f84cef841092bb98916f (diff) | |
parent | bb306750ce8e0973229109be3536c6574cf960bd (diff) | |
download | redot-engine-2a8531cc56a7110f8248f18b8248fb1ed346c872.tar.gz |
Merge pull request #41456 from nekomatata/x11-fix-popups
Popup fixes for X11 display server
Diffstat (limited to 'platform/osx/display_server_osx.mm')
-rw-r--r-- | platform/osx/display_server_osx.mm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index 1676e0d425..adfb47324e 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -2314,18 +2314,23 @@ DisplayServer::WindowID DisplayServerOSX::create_sub_window(WindowMode p_mode, u _THREAD_SAFE_METHOD_ WindowID id = _create_window(p_mode, p_rect); - WindowData &wd = windows[id]; for (int i = 0; i < WINDOW_FLAG_MAX; i++) { if (p_flags & (1 << i)) { window_set_flag(WindowFlags(i), true, id); } } + + return id; +} + +void DisplayServerOSX::show_window(WindowID p_id) { + WindowData &wd = windows[p_id]; + if (wd.no_focus) { [wd.window_object orderFront:nil]; } else { [wd.window_object makeKeyAndOrderFront:nil]; } - return id; } void DisplayServerOSX::_send_window_event(const WindowData &wd, WindowEvent p_event) { @@ -3774,7 +3779,7 @@ DisplayServerOSX::DisplayServerOSX(const String &p_rendering_driver, WindowMode window_set_flag(WindowFlags(i), true, main_window); } } - [windows[main_window].window_object makeKeyAndOrderFront:nil]; + show_window(MAIN_WINDOW_ID); #if defined(OPENGL_ENABLED) if (rendering_driver == "opengl_es") { |