diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/export/export_plugin.cpp | 2 | ||||
| -rw-r--r-- | platform/android/export/export_plugin.h | 1 | ||||
| -rw-r--r-- | platform/android/export/gradle_export_util.cpp | 2 | ||||
| -rw-r--r-- | platform/iphone/export/export_plugin.cpp | 2 | ||||
| -rw-r--r-- | platform/iphone/export/export_plugin.h | 1 | ||||
| -rw-r--r-- | platform/javascript/export/export_plugin.cpp | 3 | ||||
| -rw-r--r-- | platform/javascript/export/export_plugin.h | 4 | ||||
| -rw-r--r-- | platform/linuxbsd/os_linuxbsd.h | 2 | ||||
| -rw-r--r-- | platform/osx/display_server_osx.h | 2 | ||||
| -rw-r--r-- | platform/osx/display_server_osx.mm | 28 | ||||
| -rw-r--r-- | platform/osx/export/export_plugin.cpp | 1 | ||||
| -rw-r--r-- | platform/osx/export/export_plugin.h | 1 | ||||
| -rw-r--r-- | platform/osx/godot_content_view.mm | 4 | ||||
| -rw-r--r-- | platform/uwp/export/app_packager.cpp | 2 | ||||
| -rw-r--r-- | platform/uwp/export/app_packager.h | 1 | ||||
| -rw-r--r-- | platform/windows/display_server_windows.cpp | 25 | ||||
| -rw-r--r-- | platform/windows/display_server_windows.h | 2 | ||||
| -rw-r--r-- | platform/windows/export/export_plugin.cpp | 3 | ||||
| -rw-r--r-- | platform/windows/export/export_plugin.h | 1 | ||||
| -rw-r--r-- | platform/windows/os_windows.h | 2 |
20 files changed, 75 insertions, 14 deletions
diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index df2d32e152..464488967e 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -30,6 +30,8 @@ #include "export_plugin.h" +#include "editor/editor_node.h" + static const char *android_perms[] = { "ACCESS_CHECKIN_PROPERTIES", "ACCESS_COARSE_LOCATION", diff --git a/platform/android/export/export_plugin.h b/platform/android/export/export_plugin.h index 9e952ecb8f..c158a273d2 100644 --- a/platform/android/export/export_plugin.h +++ b/platform/android/export/export_plugin.h @@ -41,7 +41,6 @@ #include "drivers/png/png_driver_common.h" #include "editor/editor_export.h" #include "editor/editor_log.h" -#include "editor/editor_node.h" #include "editor/editor_settings.h" #include "main/splash.gen.h" #include "platform/android/logo.gen.h" diff --git a/platform/android/export/gradle_export_util.cpp b/platform/android/export/gradle_export_util.cpp index babd8173d0..9598d2f9fd 100644 --- a/platform/android/export/gradle_export_util.cpp +++ b/platform/android/export/gradle_export_util.cpp @@ -30,6 +30,8 @@ #include "gradle_export_util.h" +#include "core/config/project_settings.h" + int _get_android_orientation_value(DisplayServer::ScreenOrientation screen_orientation) { switch (screen_orientation) { case DisplayServer::SCREEN_PORTRAIT: diff --git a/platform/iphone/export/export_plugin.cpp b/platform/iphone/export/export_plugin.cpp index 122e64d6a1..69c6df8a38 100644 --- a/platform/iphone/export/export_plugin.cpp +++ b/platform/iphone/export/export_plugin.cpp @@ -30,6 +30,8 @@ #include "export_plugin.h" +#include "editor/editor_node.h" + void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { String driver = ProjectSettings::get_singleton()->get("rendering/driver/driver_name"); // Vulkan and OpenGL ES 3.0 both mandate ETC2 support. diff --git a/platform/iphone/export/export_plugin.h b/platform/iphone/export/export_plugin.h index 93b23f7ee2..c01983e39f 100644 --- a/platform/iphone/export/export_plugin.h +++ b/platform/iphone/export/export_plugin.h @@ -41,7 +41,6 @@ #include "core/templates/safe_refcount.h" #include "core/version.h" #include "editor/editor_export.h" -#include "editor/editor_node.h" #include "editor/editor_settings.h" #include "main/splash.gen.h" #include "platform/iphone/logo.gen.h" diff --git a/platform/javascript/export/export_plugin.cpp b/platform/javascript/export/export_plugin.cpp index d4c198d631..8a1360e421 100644 --- a/platform/javascript/export/export_plugin.cpp +++ b/platform/javascript/export/export_plugin.cpp @@ -30,6 +30,9 @@ #include "export_plugin.h" +#include "core/config/project_settings.h" +#include "editor/editor_node.h" + Error EditorExportPlatformJavaScript::_extract_template(const String &p_template, const String &p_dir, const String &p_name, bool pwa) { FileAccess *src_f = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); diff --git a/platform/javascript/export/export_plugin.h b/platform/javascript/export/export_plugin.h index 278e317430..8d4307548c 100644 --- a/platform/javascript/export/export_plugin.h +++ b/platform/javascript/export/export_plugin.h @@ -31,18 +31,20 @@ #ifndef JAVASCRIPT_EXPORT_PLUGIN_H #define JAVASCRIPT_EXPORT_PLUGIN_H +#include "core/config/project_settings.h" #include "core/io/image_loader.h" #include "core/io/stream_peer_ssl.h" #include "core/io/tcp_server.h" #include "core/io/zip_io.h" #include "editor/editor_export.h" -#include "editor/editor_node.h" #include "main/splash.gen.h" #include "platform/javascript/logo.gen.h" #include "platform/javascript/run_icon.gen.h" #include "export_server.h" +class EditorNode; + class EditorExportPlatformJavaScript : public EditorExportPlatform { GDCLASS(EditorExportPlatformJavaScript, EditorExportPlatform); diff --git a/platform/linuxbsd/os_linuxbsd.h b/platform/linuxbsd/os_linuxbsd.h index ad6e4cd168..d97a528ece 100644 --- a/platform/linuxbsd/os_linuxbsd.h +++ b/platform/linuxbsd/os_linuxbsd.h @@ -39,8 +39,6 @@ #include "drivers/unix/os_unix.h" #include "joypad_linux.h" #include "servers/audio_server.h" -#include "servers/rendering/renderer_compositor.h" -#include "servers/rendering_server.h" class OS_LinuxBSD : public OS_Unix { virtual void delete_main_loop() override; diff --git a/platform/osx/display_server_osx.h b/platform/osx/display_server_osx.h index eaf03d298e..2b57983ca7 100644 --- a/platform/osx/display_server_osx.h +++ b/platform/osx/display_server_osx.h @@ -95,6 +95,7 @@ public: ObjectID instance_id; WindowID transient_parent = INVALID_WINDOW_ID; + bool exclusive = false; Set<WindowID> transient_children; bool layered_window = false; @@ -274,6 +275,7 @@ public: virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID) override; virtual void window_set_transient(WindowID p_window, WindowID p_parent) override; + virtual void window_set_exclusive(WindowID p_window, bool p_exclusive) override; virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override; virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override; diff --git a/platform/osx/display_server_osx.mm b/platform/osx/display_server_osx.mm index 137b1b45b0..b7258e6cf4 100644 --- a/platform/osx/display_server_osx.mm +++ b/platform/osx/display_server_osx.mm @@ -1471,6 +1471,24 @@ void DisplayServerOSX::window_set_current_screen(int p_screen, WindowID p_window } } +void DisplayServerOSX::window_set_exclusive(WindowID p_window, bool p_exclusive) { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND(!windows.has(p_window)); + WindowData &wd = windows[p_window]; + if (wd.exclusive != p_exclusive) { + wd.exclusive = p_exclusive; + if (wd.transient_parent != INVALID_WINDOW_ID) { + WindowData &wd_parent = windows[wd.transient_parent]; + if (wd.exclusive) { + ERR_FAIL_COND_MSG([[wd_parent.window_object childWindows] count] > 0, "Transient parent has another exclusive child."); + [wd_parent.window_object addChildWindow:wd.window_object ordered:NSWindowAbove]; + } else { + [wd_parent.window_object removeChildWindow:wd.window_object]; + } + } + } +} + Point2i DisplayServerOSX::window_get_position(WindowID p_window) const { _THREAD_SAFE_METHOD_ @@ -1541,8 +1559,11 @@ void DisplayServerOSX::window_set_transient(WindowID p_window, WindowID p_parent wd_window.transient_parent = INVALID_WINDOW_ID; wd_parent.transient_children.erase(p_window); - [wd_window.window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; + + if (wd_window.exclusive) { + [wd_parent.window_object removeChildWindow:wd_window.window_object]; + } } else { ERR_FAIL_COND(!windows.has(p_parent)); ERR_FAIL_COND_MSG(wd_window.transient_parent != INVALID_WINDOW_ID, "Window already has a transient parent"); @@ -1550,8 +1571,11 @@ void DisplayServerOSX::window_set_transient(WindowID p_window, WindowID p_parent wd_window.transient_parent = p_parent; wd_parent.transient_children.insert(p_window); - [wd_window.window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; + + if (wd_window.exclusive) { + [wd_parent.window_object addChildWindow:wd_window.window_object ordered:NSWindowAbove]; + } } } diff --git a/platform/osx/export/export_plugin.cpp b/platform/osx/export/export_plugin.cpp index f0b58efb63..4d5c0a827a 100644 --- a/platform/osx/export/export_plugin.cpp +++ b/platform/osx/export/export_plugin.cpp @@ -31,6 +31,7 @@ #include "modules/modules_enabled.gen.h" // For regex. #include "codesign.h" +#include "editor/editor_node.h" #include "export_plugin.h" void EditorExportPlatformOSX::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { diff --git a/platform/osx/export/export_plugin.h b/platform/osx/export/export_plugin.h index 931ce7e41a..b85e9d662c 100644 --- a/platform/osx/export/export_plugin.h +++ b/platform/osx/export/export_plugin.h @@ -40,7 +40,6 @@ #include "core/os/os.h" #include "core/version.h" #include "editor/editor_export.h" -#include "editor/editor_node.h" #include "editor/editor_settings.h" #include "platform/osx/logo.gen.h" diff --git a/platform/osx/godot_content_view.mm b/platform/osx/godot_content_view.mm index 4e831e1ccc..76d9cfb081 100644 --- a/platform/osx/godot_content_view.mm +++ b/platform/osx/godot_content_view.mm @@ -117,6 +117,10 @@ } } +- (void)doCommandBySelector:(SEL)aSelector { + [self tryToPerform:aSelector with:self]; +} + - (void)unmarkText { ime_input_event_in_progress = false; [[marked_text mutableString] setString:@""]; diff --git a/platform/uwp/export/app_packager.cpp b/platform/uwp/export/app_packager.cpp index 9b586a640e..c7b3bc9854 100644 --- a/platform/uwp/export/app_packager.cpp +++ b/platform/uwp/export/app_packager.cpp @@ -30,6 +30,8 @@ #include "app_packager.h" +#include "editor/editor_node.h" + String AppxPackager::hash_block(const uint8_t *p_block_data, size_t p_block_len) { unsigned char hash[32]; char base64[45]; diff --git a/platform/uwp/export/app_packager.h b/platform/uwp/export/app_packager.h index a5f5896592..da118449c7 100644 --- a/platform/uwp/export/app_packager.h +++ b/platform/uwp/export/app_packager.h @@ -41,7 +41,6 @@ #include "core/object/class_db.h" #include "core/version.h" #include "editor/editor_export.h" -#include "editor/editor_node.h" #include "thirdparty/minizip/unzip.h" #include "thirdparty/minizip/zip.h" diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 36c87f2683..c7955ebf31 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -830,6 +830,23 @@ void DisplayServerWindows::window_set_position(const Point2i &p_position, Window _update_real_mouse_position(p_window); } +void DisplayServerWindows::window_set_exclusive(WindowID p_window, bool p_exclusive) { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND(!windows.has(p_window)); + WindowData &wd = windows[p_window]; + if (wd.exclusive != p_exclusive) { + wd.exclusive = p_exclusive; + if (wd.transient_parent != INVALID_WINDOW_ID) { + WindowData &wd_parent = windows[wd.transient_parent]; + if (wd.exclusive) { + SetWindowLongPtr(wd.hWnd, GWLP_HWNDPARENT, (LONG_PTR)wd_parent.hWnd); + } else { + SetWindowLongPtr(wd.hWnd, GWLP_HWNDPARENT, (LONG_PTR) nullptr); + } + } + } +} + void DisplayServerWindows::window_set_transient(WindowID p_window, WindowID p_parent) { _THREAD_SAFE_METHOD_ @@ -852,7 +869,9 @@ void DisplayServerWindows::window_set_transient(WindowID p_window, WindowID p_pa wd_window.transient_parent = INVALID_WINDOW_ID; wd_parent.transient_children.erase(p_window); - SetWindowLongPtr(wd_window.hWnd, GWLP_HWNDPARENT, (LONG_PTR) nullptr); + if (wd_window.exclusive) { + SetWindowLongPtr(wd_window.hWnd, GWLP_HWNDPARENT, (LONG_PTR) nullptr); + } } else { ERR_FAIL_COND(!windows.has(p_parent)); ERR_FAIL_COND_MSG(wd_window.transient_parent != INVALID_WINDOW_ID, "Window already has a transient parent"); @@ -861,7 +880,9 @@ void DisplayServerWindows::window_set_transient(WindowID p_window, WindowID p_pa wd_window.transient_parent = p_parent; wd_parent.transient_children.insert(p_window); - SetWindowLongPtr(wd_window.hWnd, GWLP_HWNDPARENT, (LONG_PTR)wd_parent.hWnd); + if (wd_window.exclusive) { + SetWindowLongPtr(wd_window.hWnd, GWLP_HWNDPARENT, (LONG_PTR)wd_parent.hWnd); + } } } diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index d36ca97ebe..7561f9bb77 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -339,6 +339,7 @@ class DisplayServerWindows : public DisplayServer { bool always_on_top = false; bool no_focus = false; bool window_has_focus = false; + bool exclusive = false; // Used to transfer data between events using timer. WPARAM saved_wparam; @@ -499,6 +500,7 @@ public: virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID) override; virtual void window_set_transient(WindowID p_window, WindowID p_parent) override; + virtual void window_set_exclusive(WindowID p_window, bool p_exclusive) override; virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override; virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override; diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index d30d0afc5c..5ebc930735 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -30,6 +30,9 @@ #include "export_plugin.h" +#include "core/config/project_settings.h" +#include "editor/editor_node.h" + Error EditorExportPlatformWindows::sign_shared_object(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path) { if (p_preset->get("codesign/enable")) { return _code_sign(p_preset, p_path); diff --git a/platform/windows/export/export_plugin.h b/platform/windows/export/export_plugin.h index 89e5b1b635..86e9d49b05 100644 --- a/platform/windows/export/export_plugin.h +++ b/platform/windows/export/export_plugin.h @@ -34,7 +34,6 @@ #include "core/io/file_access.h" #include "core/os/os.h" #include "editor/editor_export.h" -#include "editor/editor_node.h" #include "editor/editor_settings.h" #include "platform/windows/logo.gen.h" diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 28baa855b4..0a11416b1b 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -40,8 +40,6 @@ #include "drivers/winmidi/midi_driver_winmidi.h" #include "key_mapping_windows.h" #include "servers/audio_server.h" -#include "servers/rendering/renderer_compositor.h" -#include "servers/rendering_server.h" #ifdef XAUDIO2_ENABLED #include "drivers/xaudio2/audio_driver_xaudio2.h" #endif |