From fd2f5f4678dcca15b949dd40ed16c0a187c7c91a Mon Sep 17 00:00:00 2001 From: luboslenco Date: Mon, 4 Aug 2025 10:22:36 +0200 Subject: [PATCH] Fix ui redraw issues on windows --- base/sources/iron_ui.c | 15 ++++++--------- base/sources/iron_ui.h | 1 - base/sources/ts/base.ts | 16 +--------------- base/sources/ts/iron/iron.ts | 1 - 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/base/sources/iron_ui.c b/base/sources/iron_ui.c index f0e407c2..e8aa96cb 100644 --- a/base/sources/iron_ui.c +++ b/base/sources/iron_ui.c @@ -25,7 +25,6 @@ static bool ui_combo_first = true; static ui_handle_t *ui_combo_search_handle = NULL; ui_t *ui_instances[UI_MAX_INSTANCES]; int ui_instances_count; -bool ui_always_redraw_window = true; // Redraw cached window texture each frame or on changes only bool ui_touch_scroll = false; // Pan with finger to scroll bool ui_touch_hold = false; // Touch and hold finger for right click bool ui_touch_tooltip = false; // Show extra tooltips above finger / on-screen keyboard @@ -1652,15 +1651,13 @@ void ui_end_window() { current->window_ended = true; // Draw window texture - if (ui_always_redraw_window || handle->redraws > -4) { - draw_begin(NULL, false, 0); - draw_set_color(0xffffffff); - draw_image(&handle->texture, current->_window_x, current->_window_y); - if (handle->redraws <= 0) { - handle->redraws--; - } - draw_end(); + draw_begin(NULL, false, 0); + draw_set_color(0xffffffff); + draw_image(&handle->texture, current->_window_x, current->_window_y); + if (handle->redraws <= 0) { + handle->redraws--; } + draw_end(); } bool ui_window_dirty(ui_handle_t *handle, int x, int y, int w, int h) { diff --git a/base/sources/iron_ui.h b/base/sources/iron_ui.h index d3af5088..e0e9112d 100644 --- a/base/sources/iron_ui.h +++ b/base/sources/iron_ui.h @@ -367,7 +367,6 @@ float UI_TOOLTIP_DELAY(); #define UI_MAX_INSTANCES 8 extern ui_t *ui_instances[UI_MAX_INSTANCES]; extern int ui_instances_count; -extern bool ui_always_redraw_window; extern bool ui_touch_scroll; extern bool ui_touch_hold; extern bool ui_touch_tooltip; diff --git a/base/sources/ts/base.ts b/base/sources/ts/base.ts index 2b128cc3..4adf1f71 100644 --- a/base/sources/ts/base.ts +++ b/base/sources/ts/base.ts @@ -447,21 +447,7 @@ function base_update() { base_handle_drop_paths(); - ///if arm_windows - let is_picker: bool = context_is_picker(); - let decal: bool = context_is_decal(); - ui_always_redraw_window = //!context_raw.cache_draws || - ui_menu_show || - ui_box_show || - base_is_dragging || - is_picker || - decal || - ui_view2d_show || - !config_raw.brush_3d || - context_raw.frame < 3; - ///end - - if (ui_always_redraw_window && context_raw.ddirty < 0) { + if (context_raw.ddirty < 0) { context_raw.ddirty = 0; } diff --git a/base/sources/ts/iron/iron.ts b/base/sources/ts/iron/iron.ts index d3c00901..75f9fa82 100644 --- a/base/sources/ts/iron/iron.ts +++ b/base/sources/ts/iron/iron.ts @@ -685,7 +685,6 @@ declare let ui_nodes_enum_texts: (s: string)=>string[]; declare let ui_touch_scroll: bool; declare let ui_touch_hold : bool; declare let ui_touch_tooltip: bool; -declare let ui_always_redraw_window: bool; declare let ui_on_border_hover: any; declare let ui_on_text_hover: any; declare let ui_on_deselect_text: any;