From cfff93537ad64b73f791808f220097c3db8ef831 Mon Sep 17 00:00:00 2001 From: Sarah Frank Date: Sat, 11 Apr 2026 13:45:32 -0400 Subject: [PATCH] feat: add option to disable trickle down event queue --- dearpygui/_dearpygui.pyi | 2 +- src/dearpygui_commands.h | 6 ++++++ src/dearpygui_parsers.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dearpygui/_dearpygui.pyi b/dearpygui/_dearpygui.pyi index 456a4b845..ba1f2b349 100644 --- a/dearpygui/_dearpygui.pyi +++ b/dearpygui/_dearpygui.pyi @@ -667,7 +667,7 @@ def clear_selected_nodes(node_editor : Union[int, str]) -> None: """Clears a node editor's selected nodes.""" ... -def configure_app(*, load_init_file: str ='', docking: bool ='', docking_space: bool ='', docking_shift_only: bool ='', init_file: str ='', auto_save_init_file: bool ='', device: int ='', auto_device: bool ='', allow_alias_overwrites: bool ='', manual_alias_management: bool ='', skip_required_args: bool ='', skip_positional_args: bool ='', skip_keyword_args: bool ='', wait_for_input: bool ='', manual_callback_management: bool ='', keyboard_navigation: bool ='', anti_aliased_lines: bool ='', anti_aliased_lines_use_tex: bool ='', anti_aliased_fill: bool ='', win32_alt_enter_fullscreen: bool ='', **kwargs) -> None: +def configure_app(*, load_init_file: str ='', docking: bool ='', docking_space: bool ='', docking_shift_only: bool ='', init_file: str ='', auto_save_init_file: bool ='', device: int ='', auto_device: bool ='', allow_alias_overwrites: bool ='', manual_alias_management: bool ='', skip_required_args: bool ='', skip_positional_args: bool ='', skip_keyword_args: bool ='', wait_for_input: bool ='', manual_callback_management: bool ='', keyboard_navigation: bool ='', anti_aliased_lines: bool ='', anti_aliased_lines_use_tex: bool ='', anti_aliased_fill: bool ='', win32_alt_enter_fullscreen: bool ='', input_trickle_event_queue: bool ='', **kwargs) -> None: """Configures app.""" ... diff --git a/src/dearpygui_commands.h b/src/dearpygui_commands.h index 4a8b5cbe1..5c9d9854f 100644 --- a/src/dearpygui_commands.h +++ b/src/dearpygui_commands.h @@ -2739,6 +2739,9 @@ configure_app(PyObject* self, PyObject* args, PyObject* kwargs) if (PyObject* item = PyDict_GetItemString(kwargs, "win32_alt_enter_fullscreen")) GContext->IO.altEnterFullscreen = ToBool(item); + ImGuiIO& io = ImGui::GetIO(); + if (PyObject* item = PyDict_GetItemString(kwargs, "input_trickle_event_queue")) io.ConfigInputTrickleEventQueue = ToBool(item); + return GetPyNone(); } @@ -2776,6 +2779,9 @@ get_app_configuration(PyObject* self, PyObject* args, PyObject* kwargs) PyDict_SetItemString(pdict, "win32_alt_enter_fullscreen", mvPyObject(ToPyBool(GContext->IO.altEnterFullscreen))); + ImGuiIO& io = ImGui::GetIO(); + PyDict_SetItemString(pdict, "input_trickle_event_queue", mvPyObject(ToPyBool(io.ConfigInputTrickleEventQueue))); + return pdict; } diff --git a/src/dearpygui_parsers.h b/src/dearpygui_parsers.h index 45ca82536..2d077bc83 100644 --- a/src/dearpygui_parsers.h +++ b/src/dearpygui_parsers.h @@ -539,6 +539,7 @@ InsertParser_Block1(std::map& parsers) args.push_back({ mvPyDataType::Bool, "anti_aliased_lines_use_tex", mvArgType::KEYWORD_ARG, "False", "Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). Latched at the beginning of the frame." }); args.push_back({ mvPyDataType::Bool, "anti_aliased_fill", mvArgType::KEYWORD_ARG, "False", "Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame." }); args.push_back({ mvPyDataType::Bool, "win32_alt_enter_fullscreen", mvArgType::KEYWORD_ARG, "False", "Windows only: configures Alt+Enter as a fullscreen hotkey." }); + args.push_back({ mvPyDataType::Bool, "input_trickle_event_queue", mvArgType::KEYWORD_ARG, "True", "Enable input event trickling: distributes rapid input events across multiple frames to prevent missed inputs at low framerates. Disable for high-frequency input devices like barcode scanners." }); mvPythonParserSetup setup; setup.about = "Configures app.";