Skip to content
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
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ jobs:
}
"@
Add-Type -AssemblyName System.Windows.Forms, System.Drawing
$env:RESMON_PERF = "1"
$p = Start-Process target/release/ResourceMonitor.exe -PassThru
Start-Sleep -Seconds 12
# A second launch asks the running app to show the panel, pinned.
Expand Down Expand Up @@ -423,8 +424,26 @@ jobs:
Start-Sleep -Seconds 6
Grab "target/popup-shots/popup-light.png"
if ($ov -ne [IntPtr]::Zero) { Grab "target/popup-shots/widget-both.png" $ov }
# More picked than the screen is tall: the panel stops at the work area and scrolls.
$more = "counts", "sec|cpu", "sec|memory", "sec|disks", "sec|network", "sec|pc", "chart|cpu", "part|memory", "card|cpu|cores", "card|cpu|power", "card|memory|commit", "fact|cpu|power|DPC",
"fact|memory|commit|HARD FAULTS", "drive|drive:C", "chart|drive:C", "card|drive:C|drive-facts", "card|net|adapters-list", "card|net|connection", "addon|usb", "bt|{not-here}"
Add-Content "$dir/settings.ini" "`ntheme = dark`naddon_usb = 1`nhover_more = $($more -join ', ')`n"
Start-Sleep -Seconds 8
Grab "target/popup-shots/popup-more.png"
[void][W4]::GetWindowRect($h, [ref]$r)
$wa = [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea
Write-Host "panel $($r.L),$($r.T) - $($r.Rt),$($r.B); work area $($wa.Left),$($wa.Top) - $($wa.Right),$($wa.Bottom)"
if ($r.T -lt $wa.Top -or $r.B -gt $wa.Bottom) { Write-Error "panel leaves the work area"; exit 1 }
if (($r.B - $r.T) -lt ($wa.Height - 60)) { Write-Error "panel did not fill the work area"; exit 1 }
[void][W4]::SetCursorPos($r.L + 200, $r.T + 300); Start-Sleep -Milliseconds 300
for ($i = 0; $i -lt 60; $i++) { [W4]::mouse_event(0x0800, 0, 0, [uint32]4294967176, [UIntPtr]::Zero); Start-Sleep -Milliseconds 80 }
Start-Sleep -Seconds 2
Grab "target/popup-shots/popup-more-end.png"
$a = (Get-FileHash target/popup-shots/popup-more.png).Hash; $b = (Get-FileHash target/popup-shots/popup-more-end.png).Hash
if ($a -eq $b) { Write-Error "the panel did not scroll"; exit 1 }
}
$log = "$dir/diagnostics.log"
if (Test-Path $log) { Select-String -Path $log -Pattern "perf popup" | Select-Object -Last 8 | ForEach-Object { $_.Line } }
if (Test-Path $log) { Get-Content $log -Tail 30 }
if ($p.HasExited) { Write-Error "app exited early (code $($p.ExitCode))"; exit 1 }
Stop-Process -Id $p.Id
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "resmon"
version = "2.34.0"
version = "2.35.0"
edition = "2021"
authors = ["Emulsion Labs"]
description = "Ultra-light taskbar resource monitor for Windows 10/11"
Expand Down
2 changes: 1 addition & 1 deletion res/resmon.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="ResourceMonitor" version="2.34.0.0"/>
<assemblyIdentity type="win32" name="ResourceMonitor" version="2.35.0.0"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security><requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
Expand Down
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; Inno Setup script. Build the exe first: cargo build --release
#define MyAppName "Resource Monitor"
#define MyAppVersion "2.34.0"
#define MyAppVersion "2.35.0"
#define MyAppPublisher "Emulsion Labs"
#define MyAppURL "https://github.com/rajhansgithub/Windows_Resource_Monitoring_Tool"
#define MyAppExeName "ResourceMonitor.exe"
Expand Down
29 changes: 27 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@ pub struct App {
pub popup_dark: bool,
/// A WM_MOUSELEAVE for the details panel is pending.
pub popup_tracking: bool,
/// Items picked on the Monitor pages, as the popup draws them (None = none picked).
pub popup_board: Option<Box<crate::monitor::hover::Board>>,
pub popup_scroll: crate::scroll::Scroll,
/// The popup's scroll animates (its frame clock runs).
pub popup_scrolling: bool,
/// Scroll offset of the popup's last painted frame.
pub popup_drawn: i32,
/// Dragging the popup's scroll bar: where the thumb was grabbed.
pub popup_drag: Option<i32>,
}

impl Deref for App {
Expand Down Expand Up @@ -552,6 +561,11 @@ pub fn create(hinst: HINSTANCE, after_update: bool) -> Option<()> {
popup_acrylic: false,
popup_dark: true,
popup_tracking: false,
popup_board: None,
popup_scroll: Default::default(),
popup_scrolling: false,
popup_drawn: 0,
popup_drag: None,
icons: None,
alerts: AlertState::default(),
ach: crate::achievements::observer::Observer::new(),
Expand Down Expand Up @@ -790,6 +804,9 @@ impl App {

fn opts(&self) -> SampleOpts {
let sh = |m| self.m.s.shown(m);
// Items picked for the hover window are read while it is open (or about to open).
let page = crate::settings_ui::monitor_warm();
let hover = if self.detail_warm() { crate::monitor::hover::needs(&self.m.s.hover_more, self.popup_board.as_ref().and_then(|b| b.screen)) } else { Default::default() };
SampleOpts {
adapter: (!self.m.s.adapter.is_empty()).then(|| self.m.s.adapter.clone()),
// GPU engine counters are the only costly source: query them only when needed.
Expand All @@ -802,7 +819,9 @@ impl App {
procs: sh(Metric::TopProc) || self.detail_warm() || self.ins.wants_procs(),
// The Monitor page is on screen, or was within the last minute: it stays warm so
// coming back shows live numbers and unbroken charts at once (no extra timer).
detail: crate::settings_ui::monitor_warm(),
detail: page || hover.detail,
hover_only: !page,
hover,
dev: crate::settings_ui::monitor_dev(),
bt: self.m.s.mod_bluetooth,
addons: self.m.s.addons_on(),
Expand All @@ -819,8 +838,11 @@ impl App {
self.detail_until = Some(Instant::now() + std::time::Duration::from_secs(30));
if cold {
// Take a baseline now so rates/percentages exist on the next tick.
// Picked items need numbers as it opens: a real sample (new counters prime
// themselves on the sensor thread).
let opts = self.opts();
self.sensors.request(opts, true);
let real = opts.hover.detail;
self.sensors.request(opts, !real);
}
}

Expand Down Expand Up @@ -911,6 +933,9 @@ impl App {
}
m.snap = snap;
m.samples += 1;
if opts.detail && self.detail_warm() && !self.m.s.hover_more.is_empty() {
popup::update(self, true);
}

if self.last_save.elapsed().as_secs() >= 60 {
self.m.usage.save();
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod perf;
mod popup;
mod render;
mod report;
mod scroll;
mod sensors;
mod settings;
mod settings_ui;
Expand Down
Loading
Loading