Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ pub struct Args {
#[arg(short = 'p', long, default_value_t = false)]
pub disable_process_monitoring: bool,

/// Do not pause graphical updates when the application is suspended
#[arg(short = 's', long, default_value_t = false)]
pub no_suspend_pause: bool,

/// Open tab specified by ID.
/// Valid IDs are: "applications", "processes", "cpu", "memory", "gpu-$PCI_SLOT$",
/// "drive-$MODEL_NAME_OR_DEVICE_NAME$", "network-$INTERFACE_NAME$",
Expand Down
4 changes: 3 additions & 1 deletion src/ui/widgets/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ impl ResGraph {
}

pub fn queue_draw_if_not_suspended(&self) {
if Application::try_default()
if crate::gui::ARGS.no_suspend_pause {
self.imp().obj().queue_draw();
} else if Application::try_default()
.and_then(|app| app.try_main_window())
.map(|main_window| main_window.is_suspended())
.unwrap_or_default()
Expand Down
24 changes: 13 additions & 11 deletions src/ui/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,20 @@ impl MainWindow {
));
self.add_controller(event_controller);

self.connect_suspended_notify(clone!(
#[weak]
imp,
move |window| {
imp.pause_updates.set(window.is_suspended());
if window.is_suspended() {
debug!("Resources has been suspended, halting graphical updates");
} else {
debug!("Resources is not suspended anymore, resuming graphical updates");
if !ARGS.no_suspend_pause {
self.connect_suspended_notify(clone!(
#[weak]
imp,
move |window| {
imp.pause_updates.set(window.is_suspended());
if window.is_suspended() {
debug!("Resources has been suspended, halting graphical updates");
} else {
debug!("Resources is not suspended anymore, resuming graphical updates");
}
}
}
));
));
}
}

fn get_selected_page(&self) -> Option<Widget> {
Expand Down
Loading