diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2020-08-22 14:23:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-22 17:23:27 -0400 |
commit | 1a25fbb98788a4e002247448fdf28837d49fd944 (patch) | |
tree | c09d37ef7f08b275612916a8a5b7c109891857c1 /src/lib.rs | |
parent | 3394b9ee6699195c400d152cf82cd9ab92585164 (diff) |
bug: fix freezing not affecting processes during search and sort
Fixes a bug where searching refreshed process data even when frozen.
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 38 |
1 files changed, 21 insertions, 17 deletions
@@ -426,9 +426,11 @@ pub fn update_all_process_lists(app: &mut App) { .cloned() .collect::<Vec<_>>(); - widget_ids.into_iter().for_each(|widget_id| { - update_final_process_list(app, widget_id); - }); + if !app.is_frozen { + widget_ids.into_iter().for_each(|widget_id| { + update_final_process_list(app, widget_id); + }); + } } pub fn update_final_process_list(app: &mut App, widget_id: u64) { @@ -441,20 +443,22 @@ pub fn update_final_process_list(app: &mut App, widget_id: u64) { }; let is_grouped = app.is_grouped(widget_id); - if let Some(proc_widget_state) = app.proc_state.get_mut_widget_state(widget_id) { - app.canvas_data.process_data = convert_process_data( - &app.data_collection, - if is_grouped { - ProcessGroupingType::Grouped - } else { - ProcessGroupingType::Ungrouped - }, - if proc_widget_state.is_using_command { - ProcessNamingType::Path - } else { - ProcessNamingType::Name - }, - ); + if !app.is_frozen { + if let Some(proc_widget_state) = app.proc_state.get_mut_widget_state(widget_id) { + app.canvas_data.process_data = convert_process_data( + &app.data_collection, + if is_grouped { + ProcessGroupingType::Grouped + } else { + ProcessGroupingType::Ungrouped + }, + if proc_widget_state.is_using_command { + ProcessNamingType::Path + } else { + ProcessNamingType::Name + }, + ); + } } let process_filter = app.get_process_filter(widget_id); |