diff --git a/src/df/gfx/df_views.c b/src/df/gfx/df_views.c index a74ba66c1..73b46d245 100644 --- a/src/df/gfx/df_views.c +++ b/src/df/gfx/df_views.c @@ -847,6 +847,15 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW } } + // check if edit is still live and focus is on the same panel + if(ui_is_focus_active()) + { + ui_state->is_editing = ewv->input_editing; + } + else if(ewv->input_editing) + { + ui_state->is_editing = 0; + } ////////////////////////////// //- rjf: build ui // @@ -1565,6 +1574,7 @@ df_eval_watch_view_build(DF_Window *ws, DF_Panel *panel, DF_View *view, DF_EvalW if(edit_end) { ewv->input_editing = 0; + ui_state->is_editing = 0; } ////////////////////////////// @@ -2943,6 +2953,16 @@ DF_VIEW_UI_FUNCTION_DEF(Target) } } } + + // check if edit is still live and focus is on the same panel + if(ui_is_focus_active()) + { + ui_state->is_editing = tv->input_editing; + } + else if(tv->input_editing) + { + ui_state->is_editing = 0; + } //- rjf: build Rng1S64 visible_row_range = {0}; @@ -3113,6 +3133,7 @@ DF_VIEW_UI_FUNCTION_DEF(Target) if(edit_end) { tv->input_editing = 0; + ui_state->is_editing = 0; } if(edit_submit) { @@ -3393,6 +3414,16 @@ DF_VIEW_UI_FUNCTION_DEF(FilePathMap) } } } + + // check if edit is still live and focus is on the same panel + if(ui_is_focus_active()) + { + ui_state->is_editing = fpms->input_editing; + } + else if(fpms->input_editing) + { + ui_state->is_editing = 0; + } //- rjf: build DF_Handle commit_map = df_handle_zero(); @@ -3603,6 +3634,7 @@ DF_VIEW_UI_FUNCTION_DEF(FilePathMap) if(edit_end) { fpms->input_editing = 0; + ui_state->is_editing = 0; } //- rjf: move down one row if submitted @@ -4181,6 +4213,16 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) edit_submit = 1; } } + + // check if edit is still live and focus is on the same panel + if(ui_is_focus_active()) + { + ui_state->is_editing = mv->txt_editing; + } + else if(mv->txt_editing) + { + ui_state->is_editing = 0; + } //- rjf: build table DF_Entity *commit_module = &df_g_nil_entity; @@ -4338,6 +4380,7 @@ DF_VIEW_UI_FUNCTION_DEF(Modules) if(edit_end) { mv->txt_editing = 0; + ui_state->is_editing = 0; } //- rjf: selected num -> selected entity diff --git a/src/raddbg/raddbg.c b/src/raddbg/raddbg.c index b70ac1c9b..6fdd91360 100644 --- a/src/raddbg/raddbg.c +++ b/src/raddbg/raddbg.c @@ -157,7 +157,21 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data) { next = event->next; DF_Window *ws = df_window_from_os_handle(event->window); - if(ws == 0) + DF_CmdQueryRule query_rule = DF_CmdQueryRule_Null; + // check if focused panel has an active command query + { + DF_Panel *panel = ws->focused_panel; + if(!df_panel_is_nil(panel)) + { + DF_View *view = df_selected_view_from_panel(panel); + if(!df_view_is_nil(view)) + { + query_rule = view->cmd_spec->info.query_rule; + } + } + } + + if(ws == 0 || ui_state->is_editing || query_rule != DF_CmdQueryRule_Null) { continue; } diff --git a/src/ui/ui_core.h b/src/ui/ui_core.h index 4e6426293..4faa6b073 100644 --- a/src/ui/ui_core.h +++ b/src/ui/ui_core.h @@ -401,6 +401,7 @@ struct UI_State Vec2F32 drag_start_mouse; Arena *drag_state_arena; String8 drag_state_data; + B32 is_editing; //- rjf: context menu state UI_Key ctx_menu_anchor_key;