diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | core/extension/gdextension_interface.cpp | 24 | ||||
-rw-r--r-- | core/extension/gdextension_interface.h | 9 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 6 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.h | 1 | ||||
-rw-r--r-- | platform/linuxbsd/x11/display_server_x11.cpp | 17 | ||||
-rw-r--r-- | scene/resources/resource_format_text.cpp | 8 | ||||
-rw-r--r-- | servers/debugger/servers_debugger.cpp | 1 |
8 files changed, 45 insertions, 23 deletions
diff --git a/.gitignore b/.gitignore index ca96220570..e9beb26e7e 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ misc/hooks/pre-commit-custom-* ############################# # Buildsystem -bin/ +bin *.gen.* compile_commands.json platform/windows/godot_res.res diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp index 3bea013fab..b02a9ee368 100644 --- a/core/extension/gdextension_interface.cpp +++ b/core/extension/gdextension_interface.cpp @@ -54,14 +54,23 @@ static void gdextension_free(void *p_mem) { } // Helper print functions. -static void gdextension_print_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line) { - _err_print_error(p_function, p_file, p_line, p_description, false, ERR_HANDLER_ERROR); +static void gdextension_print_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { + _err_print_error(p_function, p_file, p_line, p_description, p_editor_notify, ERR_HANDLER_ERROR); } -static void gdextension_print_warning(const char *p_description, const char *p_function, const char *p_file, int32_t p_line) { - _err_print_error(p_function, p_file, p_line, p_description, false, ERR_HANDLER_WARNING); +static void gdextension_print_error_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { + _err_print_error(p_function, p_file, p_line, p_description, p_message, p_editor_notify, ERR_HANDLER_ERROR); } -static void gdextension_print_script_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line) { - _err_print_error(p_function, p_file, p_line, p_description, false, ERR_HANDLER_SCRIPT); +static void gdextension_print_warning(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { + _err_print_error(p_function, p_file, p_line, p_description, p_editor_notify, ERR_HANDLER_WARNING); +} +static void gdextension_print_warning_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { + _err_print_error(p_function, p_file, p_line, p_description, p_message, p_editor_notify, ERR_HANDLER_WARNING); +} +static void gdextension_print_script_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { + _err_print_error(p_function, p_file, p_line, p_description, p_editor_notify, ERR_HANDLER_SCRIPT); +} +static void gdextension_print_script_error_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { + _err_print_error(p_function, p_file, p_line, p_description, p_message, p_editor_notify, ERR_HANDLER_SCRIPT); } uint64_t gdextension_get_native_struct_size(GDExtensionConstStringNamePtr p_name) { @@ -1014,8 +1023,11 @@ void gdextension_setup_interface(GDExtensionInterface *p_interface) { gde_interface.mem_free = gdextension_free; gde_interface.print_error = gdextension_print_error; + gde_interface.print_error_with_message = gdextension_print_error_with_message; gde_interface.print_warning = gdextension_print_warning; + gde_interface.print_warning_with_message = gdextension_print_warning_with_message; gde_interface.print_script_error = gdextension_print_script_error; + gde_interface.print_script_error_with_message = gdextension_print_script_error_with_message; gde_interface.get_native_struct_size = gdextension_get_native_struct_size; diff --git a/core/extension/gdextension_interface.h b/core/extension/gdextension_interface.h index 9593afc2fb..d561d0ecbd 100644 --- a/core/extension/gdextension_interface.h +++ b/core/extension/gdextension_interface.h @@ -414,9 +414,12 @@ typedef struct { void *(*mem_realloc)(void *p_ptr, size_t p_bytes); void (*mem_free)(void *p_ptr); - void (*print_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line); - void (*print_warning)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line); - void (*print_script_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line); + void (*print_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); + void (*print_error_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); + void (*print_warning)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); + void (*print_warning_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); + void (*print_script_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); + void (*print_script_error_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); uint64_t (*get_native_struct_size)(GDExtensionConstStringNamePtr p_name); diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 32952a367d..304beec681 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -308,6 +308,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da String error = p_data[1]; bool has_stackdump = p_data[2]; breaked = true; + can_request_idle_draw = true; can_debug = can_continue; _update_buttons_state(); _set_reason_text(error, MESSAGE_ERROR); @@ -378,6 +379,8 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da vmem_total->set_tooltip_text(TTR("Bytes:") + " " + itos(total)); vmem_total->set_text(String::humanize_size(total)); + } else if (p_msg == "servers:drawn") { + can_request_idle_draw = true; } else if (p_msg == "stack_dump") { DebuggerMarshalls::ScriptStackDump stack; stack.deserialize(p_data); @@ -843,8 +846,9 @@ void ScriptEditorDebugger::_notification(int p_what) { msg.push_back(cam->get_far()); _put_msg("scene:override_camera_3D:transform", msg); } - if (breaked) { + if (breaked && can_request_idle_draw) { _put_msg("servers:draw", Array()); + can_request_idle_draw = false; } } diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h index a0c420522a..1659bbee8d 100644 --- a/editor/debugger/script_editor_debugger.h +++ b/editor/debugger/script_editor_debugger.h @@ -155,6 +155,7 @@ private: bool breaked = false; bool can_debug = false; bool move_to_foreground = true; + bool can_request_idle_draw = false; bool live_debug; diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index 493e4ad20f..525c62fbf2 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -3834,10 +3834,6 @@ void DisplayServerX11::process_events() { for (uint32_t event_index = 0; event_index < events.size(); ++event_index) { XEvent &event = events[event_index]; - if (ignore_events) { - XFreeEventData(x11_display, &event.xcookie); - continue; - } bool ime_window_event = false; WindowID window_id = MAIN_WINDOW_ID; @@ -3867,7 +3863,7 @@ void DisplayServerX11::process_events() { _refresh_device_info(); } break; case XI_RawMotion: { - if (ime_window_event) { + if (ime_window_event || ignore_events) { break; } XIRawEvent *raw_event = (XIRawEvent *)event_data; @@ -3972,7 +3968,7 @@ void DisplayServerX11::process_events() { #ifdef TOUCH_ENABLED case XI_TouchBegin: case XI_TouchEnd: { - if (ime_window_event) { + if (ime_window_event || ignore_events) { break; } bool is_begin = event_data->evtype == XI_TouchBegin; @@ -4005,7 +4001,7 @@ void DisplayServerX11::process_events() { } break; case XI_TouchUpdate: { - if (ime_window_event) { + if (ime_window_event || ignore_events) { break; } HashMap<int, Vector2>::Iterator curr_pos_elem = xi.state.find(index); @@ -4227,7 +4223,7 @@ void DisplayServerX11::process_events() { case ButtonPress: case ButtonRelease: { - if (ime_window_event) { + if (ime_window_event || ignore_events) { break; } /* exit in case of a mouse button press */ @@ -4328,7 +4324,7 @@ void DisplayServerX11::process_events() { } break; case MotionNotify: { - if (ime_window_event) { + if (ime_window_event || ignore_events) { break; } // The X11 API requires filtering one-by-one through the motion @@ -4476,6 +4472,9 @@ void DisplayServerX11::process_events() { } break; case KeyPress: case KeyRelease: { + if (ignore_events) { + break; + } #ifdef DISPLAY_SERVER_X11_DEBUG_LOGS_ENABLED if (event.type == KeyPress) { DEBUG_LOG_X11("[%u] KeyPress window=%lu (%u), keycode=%u, time=%lu \n", frame, event.xkey.window, window_id, event.xkey.keycode, event.xkey.time); diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 3006da5309..448e800900 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -601,9 +601,11 @@ Error ResourceLoaderText::load() { *progress = resource_current / float(resources_total); } - int_resources[id] = res; //always assign int resources - if (do_assign && cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { - res->set_path(path, cache_mode == ResourceFormatLoader::CACHE_MODE_REPLACE); + int_resources[id] = res; // Always assign int resources. + if (do_assign) { + if (cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { + res->set_path(path, cache_mode == ResourceFormatLoader::CACHE_MODE_REPLACE); + } res->set_scene_unique_id(id); } diff --git a/servers/debugger/servers_debugger.cpp b/servers/debugger/servers_debugger.cpp index c44f9a3a1b..75452be49b 100644 --- a/servers/debugger/servers_debugger.cpp +++ b/servers/debugger/servers_debugger.cpp @@ -409,6 +409,7 @@ Error ServersDebugger::_capture(void *p_user, const String &p_cmd, const Array & if (RenderingServer::get_singleton()->has_changed()) { RenderingServer::get_singleton()->draw(true, delta); } + EngineDebugger::get_singleton()->send_message("servers:drawn", Array()); } else if (p_cmd == "foreground") { singleton->last_draw_time = 0.0; DisplayServer::get_singleton()->window_move_to_foreground(); |