You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
MacOS: Additional improvements and fixes for embedded window support
This commit is contained in:
@@ -33,11 +33,13 @@
|
||||
#include "editor/plugins/embedded_process.h"
|
||||
|
||||
class DisplayServerMacOS;
|
||||
class EmbeddedProcessMacOS;
|
||||
|
||||
class LayerHost : public Control {
|
||||
class LayerHost final : public Control {
|
||||
GDCLASS(LayerHost, Control);
|
||||
|
||||
ScriptEditorDebugger *script_debugger = nullptr;
|
||||
EmbeddedProcessMacOS *process = nullptr;
|
||||
|
||||
virtual void gui_input(const Ref<InputEvent> &p_event) override;
|
||||
|
||||
@@ -48,6 +50,8 @@ public:
|
||||
void set_script_debugger(ScriptEditorDebugger *p_debugger) {
|
||||
script_debugger = p_debugger;
|
||||
}
|
||||
|
||||
LayerHost(EmbeddedProcessMacOS *p_process);
|
||||
};
|
||||
|
||||
class EmbeddedProcessMacOS final : public EmbeddedProcessBase {
|
||||
@@ -69,9 +73,11 @@ class EmbeddedProcessMacOS final : public EmbeddedProcessBase {
|
||||
|
||||
// Embedded process state.
|
||||
|
||||
/// @brief The current mouse mode of the embedded process.
|
||||
// The last mouse mode sent by the embedded process.
|
||||
DisplayServer::MouseMode mouse_mode = DisplayServer::MOUSE_MODE_VISIBLE;
|
||||
|
||||
// Helper functions.
|
||||
|
||||
void _try_embed_process();
|
||||
void update_embedded_process() const;
|
||||
void _joy_connection_changed(int p_index, bool p_connected) const;
|
||||
@@ -81,7 +87,9 @@ protected:
|
||||
|
||||
public:
|
||||
// MARK: - Message Handlers
|
||||
|
||||
void set_context_id(uint32_t p_context_id);
|
||||
void mouse_set_mode(DisplayServer::MouseMode p_mode);
|
||||
|
||||
uint32_t get_context_id() const { return context_id; }
|
||||
void set_script_debugger(ScriptEditorDebugger *p_debugger) override;
|
||||
@@ -90,7 +98,7 @@ public:
|
||||
return embedding_state == EmbeddingState::IN_PROGRESS;
|
||||
}
|
||||
|
||||
bool is_embedding_completed() const override {
|
||||
_FORCE_INLINE_ bool is_embedding_completed() const override {
|
||||
return embedding_state == EmbeddingState::COMPLETED;
|
||||
}
|
||||
|
||||
@@ -103,8 +111,10 @@ public:
|
||||
|
||||
Rect2i get_adjusted_embedded_window_rect(const Rect2i &p_rect) const override;
|
||||
|
||||
void mouse_set_mode(DisplayServer::MouseMode p_mode);
|
||||
_FORCE_INLINE_ LayerHost *get_layer_host() const { return layer_host; }
|
||||
|
||||
// MARK: - Embedded process state
|
||||
_FORCE_INLINE_ DisplayServer::MouseMode get_mouse_mode() const { return mouse_mode; }
|
||||
|
||||
EmbeddedProcessMacOS();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user