From 97d2fb567a41751d75ce3edbddab4944a4e6e186 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sat, 1 Jun 2024 13:45:10 +0200 Subject: [PATCH] Fixed missing IO graphs in IO mode, issue #867 --- src/btop_draw.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index 76ad6e2..7d908a1 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -1184,8 +1184,7 @@ namespace Mem { deque combined(disk.io_read.size(), 0); rng::transform(disk.io_read, disk.io_write, combined.begin(), std::plus()); io_graphs[name] = Draw::Graph{ - disks_width - (io_mode ? 0 : 6), - disks_io_h, "available", combined, + disks_width, disks_io_h, "available", combined, graph_symbol, false, true, speed}; } else { @@ -1290,8 +1289,8 @@ namespace Mem { + Mv::l(disks_width - 6) + io_graphs.at(mount + "_activity")(disk.io_activity, redraw or data_same) + Theme::c("main_fg"); } if (++cy > height - 3) break; - if (not io_graphs.contains(mount)) continue; if (io_graph_combined) { + if (not io_graphs.contains(mount)) continue; auto comb_val = disk.io_read.back() + disk.io_write.back(); const string humanized = (disk.io_write.back() > 0 ? "▼"s : ""s) + (disk.io_read.back() > 0 ? "▲"s : ""s) + (comb_val > 0 ? Mv::r(1) + floating_humanizer(comb_val, true) : "RW"); @@ -1301,6 +1300,7 @@ namespace Mem { cy += disks_io_h; } else { + if (not io_graphs.contains(mount + "_read") or not io_graphs.contains(mount + "_write")) continue; const string human_read = (disk.io_read.back() > 0 ? "▲" + floating_humanizer(disk.io_read.back(), true) : "R"); const string human_write = (disk.io_write.back() > 0 ? "▼" + floating_humanizer(disk.io_write.back(), true) : "W"); if (disks_io_h <= 3) out += Mv::to(y+1+cy, x+1+cx) + string(5, ' ') + Mv::to(y+cy + disks_io_h, x+1+cx) + string(5, ' ');