diff options
author | Dave Davenport <qball@gmpclient.org> | 2023-07-28 21:15:50 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2023-07-28 21:15:50 +0200 |
commit | d847629e927caef276646233043cbfc4287f9723 (patch) | |
tree | 8e3d70c45dac84bd54ae8ee27a80ffc0865117b8 /source/view.c | |
parent | 82f9605c30e0765816aa23384edf9f99f68e4544 (diff) |
Avoid some unneeded refilters when icons updates.less-refiltering
Diffstat (limited to 'source/view.c')
-rw-r--r-- | source/view.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/view.c b/source/view.c index ecf095c6..a8be46e2 100644 --- a/source/view.c +++ b/source/view.c @@ -511,7 +511,6 @@ static gboolean rofi_view_reload_idle(G_GNUC_UNUSED gpointer data) { g_free(r); } current_active_menu->reload = TRUE; - current_active_menu->refilter = TRUE; rofi_view_queue_redraw(); } CacheState.idle_timeout = 0; @@ -560,11 +559,16 @@ static void rofi_view_set_user_timeout(G_GNUC_UNUSED gpointer data) { } } -void rofi_view_reload(void) { +void rofi_view_reload(gboolean refilter) { // @TODO add check if current view is equal to the callee if (CacheState.idle_timeout == 0) { CacheState.idle_timeout = g_timeout_add(1000 / 100, rofi_view_reload_idle, NULL); + // @TODO this can be called from a separate thread (not at the moment, as + // that usecase refilter == FALSE) Should we add a lock for this? + if ( refilter && current_active_menu) { + current_active_menu->refilter = TRUE; + } } } void rofi_view_queue_redraw(void) { |