Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pik for openSUSE:Factory checked in at 2025-09-18 21:09:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pik (Old) and /work/SRC/openSUSE:Factory/.pik.new.27445 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pik" Thu Sep 18 21:09:24 2025 rev:13 rq:1305607 version:0.25.0 Changes: -------- --- /work/SRC/openSUSE:Factory/pik/pik.changes 2025-06-14 16:17:57.374829168 +0200 +++ /work/SRC/openSUSE:Factory/.pik.new.27445/pik.changes 2025-09-18 21:09:50.697347085 +0200 @@ -1,0 +2,8 @@ +Thu Sep 18 05:12:50 UTC 2025 - Muhammad Akbar Yanuar Mantari <[email protected]> + +- Update to version 0.25.0: + * fixed clippy warnings + * fix copying not working on at least niri + * renamed fps to debug component + +------------------------------------------------------------------- Old: ---- pik-0.24.0.tar.gz New: ---- pik-0.25.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pik.spec ++++++ --- /var/tmp/diff_new_pack.RlLMxo/_old 2025-09-18 21:09:51.957400031 +0200 +++ /var/tmp/diff_new_pack.RlLMxo/_new 2025-09-18 21:09:51.961400199 +0200 @@ -18,7 +18,7 @@ %bcond_without test Name: pik -Version: 0.24.0 +Version: 0.25.0 Release: 0 Summary: Process Interactive Kill License: MIT ++++++ pik-0.24.0.tar.gz -> pik-0.25.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/Cargo.lock new/pik-0.25.0/Cargo.lock --- old/pik-0.24.0/Cargo.lock 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/Cargo.lock 2025-06-29 15:23:08.000000000 +0200 @@ -107,9 +107,9 @@ [[package]] name = "arboard" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1df21f715862ede32a0c525ce2ca4d52626bb0007f8c18b87a384503ac33e70" +checksum = "55f533f8e0af236ffe5eb979b99381df3258853f00ba2e44b6e1955292c75227" dependencies = [ "clipboard-win", "image", @@ -122,6 +122,7 @@ "parking_lot", "percent-encoding", "windows-sys 0.59.0", + "wl-clipboard-rs", "x11rb", ] @@ -306,7 +307,7 @@ "crossterm_winapi", "mio", "parking_lot", - "rustix", + "rustix 0.38.44", "signal-hook", "signal-hook-mio", "winapi", @@ -353,6 +354,12 @@ ] [[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] name = "either" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -381,6 +388,12 @@ checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" [[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] name = "fdeflate" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -390,6 +403,12 @@ ] [[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] name = "flate2" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -400,6 +419,12 @@ ] [[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] name = "fuzzy-matcher" version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -426,7 +451,19 @@ dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -590,6 +627,12 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] name = "listeners" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -597,7 +640,7 @@ dependencies = [ "byteorder", "once_cell", - "rustix", + "rustix 0.38.44", "windows 0.58.0", ] @@ -613,9 +656,9 @@ [[package]] name = "log" -version = "0.4.20" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lru" @@ -633,6 +676,12 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] name = "miniz_oxide" version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -651,11 +700,21 @@ "hermit-abi", "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] [[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] name = "ntapi" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -769,6 +828,16 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] +name = "os_pipe" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] name = "parking_lot" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -804,8 +873,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] name = "pik" -version = "0.24.0" +version = "0.25.0" dependencies = [ "anyhow", "arboard", @@ -827,6 +906,12 @@ ] [[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] name = "png" version = "0.17.16" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -849,6 +934,15 @@ ] [[package]] +name = "quick-xml" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "331e97a1af0bf59823e6eadffe373d7b27f485be8748f71471c662c1f269b7fb" +dependencies = [ + "memchr", +] + +[[package]] name = "quote" version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -858,6 +952,12 @@ ] [[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] name = "ratatui" version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -894,7 +994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom", + "getrandom 0.2.14", "libredox", "thiserror", ] @@ -930,15 +1030,28 @@ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags 2.9.0", "errno", "libc", - "linux-raw-sys", - "windows-sys 0.52.0", + "linux-raw-sys 0.4.14", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", ] [[package]] @@ -1100,6 +1213,19 @@ ] [[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] name = "thiserror" version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1175,6 +1301,19 @@ ] [[package]] +name = "tree_magic_mini" +version = "3.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac5e8971f245c3389a5a76e648bfc80803ae066a1243a75db0064d7c1129d63" +dependencies = [ + "fnv", + "memchr", + "nom", + "once_cell", + "petgraph", +] + +[[package]] name = "tui-textarea" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1239,6 +1378,15 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] name = "wasm-bindgen" version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1293,6 +1441,76 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] +name = "wayland-backend" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe770181423e5fc79d3e2a7f4410b7799d5aab1de4372853de3c6aa13ca24121" +dependencies = [ + "cc", + "downcast-rs", + "rustix 0.38.44", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-client" +version = "0.31.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978fa7c67b0847dbd6a9f350ca2569174974cd4082737054dbb7fbb79d7d9a61" +dependencies = [ + "bitflags 2.9.0", + "rustix 0.38.44", + "wayland-backend", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols" +version = "0.32.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "779075454e1e9a521794fed15886323ea0feda3f8b0fc1390f5398141310422a" +dependencies = [ + "bitflags 2.9.0", + "wayland-backend", + "wayland-client", + "wayland-scanner", +] + +[[package]] +name = "wayland-protocols-wlr" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb6cdc73399c0e06504c437fe3cf886f25568dd5454473d565085b36d6a8bbf" +dependencies = [ + "bitflags 2.9.0", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-scanner", +] + +[[package]] +name = "wayland-scanner" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "896fdafd5d28145fce7958917d69f2fd44469b1d4e861cb5961bcbeebc6d1484" +dependencies = [ + "proc-macro2", + "quick-xml", + "quote", +] + +[[package]] +name = "wayland-sys" +version = "0.31.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbcebb399c77d5aa9fa5db874806ee7b4eba4e73650948e8f93963f128896615" +dependencies = [ + "pkg-config", +] + +[[package]] name = "weezl" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1643,13 +1861,41 @@ ] [[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "wl-clipboard-rs" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5ff8d0e60065f549fafd9d6cb626203ea64a798186c80d8e7df4f8af56baeb" +dependencies = [ + "libc", + "log", + "os_pipe", + "rustix 0.38.44", + "tempfile", + "thiserror", + "tree_magic_mini", + "wayland-backend", + "wayland-client", + "wayland-protocols", + "wayland-protocols-wlr", +] + +[[package]] name = "x11rb" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" dependencies = [ "gethostname", - "rustix", + "rustix 0.38.44", "x11rb-protocol", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/Cargo.toml new/pik-0.25.0/Cargo.toml --- old/pik-0.24.0/Cargo.toml 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/Cargo.toml 2025-06-29 15:23:08.000000000 +0200 @@ -1,6 +1,6 @@ [package] name = "pik" -version = "0.24.0" +version = "0.25.0" edition = "2024" authors = ["Jacek Kurlit"] keywords = ["terminal", "process", "linux", "system", "kill"] @@ -27,7 +27,7 @@ itertools = "0.14" regex = "1.11" unicode-width = "0.2" -arboard = "3.5" +arboard = { version = "3.6", features = ["wayland-data-control"] } [dev-dependencies] http-test-server = "2.1.1" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/config.md new/pik-0.25.0/config.md --- old/pik-0.24.0/config.md 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/config.md 2025-06-29 15:23:08.000000000 +0200 @@ -40,7 +40,7 @@ select_process_siblings = ["alt+s"] toggle_help = ["ctrl+h"] -toggle_fps = ["ctrl+."] +toggle_debug = ["alt+d"] cursor_left = ["left"] cursor_right = ["right"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/pik.spec new/pik-0.25.0/pik.spec --- old/pik-0.24.0/pik.spec 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/pik.spec 2025-06-29 15:23:08.000000000 +0200 @@ -1,5 +1,5 @@ Name: pik -Version: 0.24.0 +Version: 0.25.0 Release: 1%{?dist} License: MIT Summary: Process Interactive Kill is a tool that helps to find and kill process diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/config/keymappings.rs new/pik-0.25.0/src/config/keymappings.rs --- old/pik-0.24.0/src/config/keymappings.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/config/keymappings.rs 2025-06-29 15:23:08.000000000 +0200 @@ -66,7 +66,7 @@ select_process_siblings = ["alt+s"] toggle_help = ["ctrl+h"] -toggle_fps = ["ctrl+."] +toggle_debug = ["alt+d"] cursor_left = ["left"] cursor_right = ["right"] @@ -170,7 +170,7 @@ SelectProcessSiblings, ToggleHelp, - ToggleFps, + ToggleDebug, CursorLeft, CursorRight, @@ -232,7 +232,7 @@ let modi = modifier_to_str(self.modifier); let sep = if modi.is_empty() { "" } else { MOD_SEPARATOR }; let key = self.key.to_string().to_lowercase(); - write!(f, "{}{}{}", modi, sep, key) + write!(f, "{modi}{sep}{key}") } } @@ -264,7 +264,7 @@ "hyper" => KeyModifiers::HYPER, "meta" => KeyModifiers::META, invalid => { - return Err(format!("invalid modifier value '{}'", invalid)); + return Err(format!("invalid modifier value '{invalid}'")); } }; Ok(modif) @@ -301,7 +301,7 @@ "delete" => KeyCode::Delete, char if char.len() == 1 => KeyCode::Char(char.chars().next().unwrap()), invalid => { - return Err(format!("invalid key value '{}'", invalid)); + return Err(format!("invalid key value '{invalid}'")); } }; Ok(key) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/config.rs new/pik-0.25.0/src/config.rs --- old/pik-0.24.0/src/config.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/config.rs 2025-06-29 15:23:08.000000000 +0200 @@ -16,13 +16,13 @@ fn load_config_from_file(path: &std::path::PathBuf) -> Result<AppConfig> { let toml = std::fs::read_to_string(path) - .with_context(|| format!("Failed to load config from file: {:?}", path))?; + .with_context(|| format!("Failed to load config from file: {path:?}"))?; parse_config(&toml) } fn parse_config(toml: &str) -> Result<AppConfig> { let mut config: AppConfig = toml::from_str(toml) - .with_context(|| format!("Failed to deserialize config from: {:?}", toml))?; + .with_context(|| format!("Failed to deserialize config from: {toml:?}"))?; config.key_mappings = KeyMappings::preconfigured_mappings().override_with(config.key_mappings)?; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/processes/utils.rs new/pik-0.25.0/src/processes/utils.rs --- old/pik-0.24.0/src/processes/utils.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/processes/utils.rs 2025-06-29 15:23:08.000000000 +0200 @@ -7,7 +7,7 @@ use super::ProcessInfo; -// NOTE: Some processes have path to binary as first argument, but also some processes has different name than cmd (for exmaple firefox) +// NOTE: Some processes have path to binary as first argument, but also some processes has different name than cmd (for example Firefox) pub(super) fn get_process_args(prc: &impl ProcessInfo) -> Option<String> { let args = prc.args(); let cmd_path = prc.cmd_path().unwrap_or(""); @@ -29,12 +29,12 @@ let hours = seconds_diff / 3600; let minutes = (seconds_diff % 3600) / 60; if hours > 0 { - return format!("{}h {}m {}s", hours, minutes, seconds); + return format!("{hours}h {minutes}m {seconds}s"); } if minutes > 0 { - return format!("{}m {}s", minutes, seconds); + return format!("{minutes}m {seconds}s"); } - format!("{}s", seconds) + format!("{seconds}s") } pub(super) fn to_system_local_time(seconds_since_epoch: u64) -> DateTime<Local> { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/tui/components/debug.rs new/pik-0.25.0/src/tui/components/debug.rs --- old/pik-0.24.0/src/tui/components/debug.rs 1970-01-01 01:00:00.000000000 +0100 +++ new/pik-0.25.0/src/tui/components/debug.rs 2025-06-29 15:23:08.000000000 +0200 @@ -0,0 +1,62 @@ +use std::time::Instant; + +use ratatui::{Frame, crossterm::event::KeyEvent, widgets::Paragraph}; + +use crate::{config::keymappings::AppAction, tui::LayoutRects}; + +use super::{Component, KeyAction}; + +pub struct DebugComponent { + show: bool, + renders_count: usize, + last_measurement: Instant, + fps_text: Paragraph<'static>, +} + +#[allow(clippy::new_without_default)] +impl DebugComponent { + pub fn new() -> Self { + Self { + show: false, + renders_count: 0, + fps_text: Paragraph::new("FPS: 0.00").centered(), + last_measurement: Instant::now(), + } + } + + pub fn toggle(&mut self) { + self.show = !self.show; + self.last_measurement = Instant::now(); + self.renders_count = 0; + } +} + +const ONE_SECOND: u128 = 1000; + +impl Component for DebugComponent { + fn handle_input(&mut self, _: KeyEvent, action: AppAction) -> KeyAction { + if matches!(action, AppAction::ToggleDebug) { + self.toggle(); + return KeyAction::Consumed; + } + KeyAction::Unhandled + } + + fn render(&mut self, frame: &mut Frame, layout: &LayoutRects) { + if !self.show { + return; + } + self.renders_count += 1; + let now = Instant::now(); + let millis_elapsed = self.last_measurement.elapsed().as_millis(); + // once second passed since last measurements + if millis_elapsed > ONE_SECOND { + let fps = self.renders_count as f32 * 1000.0 / millis_elapsed as f32; + self.fps_text = Paragraph::new(format!("FPS: {fps:.2}")).centered(); + self.last_measurement = now; + self.renders_count = 0; + } + + frame.render_widget(&self.fps_text, layout.debug); + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/tui/components/fps_counter.rs new/pik-0.25.0/src/tui/components/fps_counter.rs --- old/pik-0.24.0/src/tui/components/fps_counter.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/tui/components/fps_counter.rs 1970-01-01 01:00:00.000000000 +0100 @@ -1,62 +0,0 @@ -use std::time::Instant; - -use ratatui::{Frame, crossterm::event::KeyEvent, widgets::Paragraph}; - -use crate::{config::keymappings::AppAction, tui::LayoutRects}; - -use super::{Component, KeyAction}; - -pub struct FpsCounter { - show: bool, - renders_count: usize, - last_measurement: Instant, - fps_text: Paragraph<'static>, -} - -#[allow(clippy::new_without_default)] -impl FpsCounter { - pub fn new() -> Self { - Self { - show: false, - renders_count: 0, - fps_text: Paragraph::new("FPS: 0.00").centered(), - last_measurement: Instant::now(), - } - } - - pub fn toggle(&mut self) { - self.show = !self.show; - self.last_measurement = Instant::now(); - self.renders_count = 0; - } -} - -const ONE_SECOND: u128 = 1000; - -impl Component for FpsCounter { - fn handle_input(&mut self, _: KeyEvent, action: AppAction) -> KeyAction { - if matches!(action, AppAction::ToggleFps) { - self.toggle(); - return KeyAction::Consumed; - } - KeyAction::Unhandled - } - - fn render(&mut self, frame: &mut Frame, layout: &LayoutRects) { - if !self.show { - return; - } - self.renders_count += 1; - let now = Instant::now(); - let millis_elapsed = self.last_measurement.elapsed().as_millis(); - // once second passed since last measurements - if millis_elapsed > ONE_SECOND { - let fps = self.renders_count as f32 * 1000.0 / millis_elapsed as f32; - self.fps_text = Paragraph::new(format!("FPS: {:.2}", fps)).centered(); - self.last_measurement = now; - self.renders_count = 0; - } - - frame.render_widget(&self.fps_text, layout.fps_counter); - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/tui/components/help_popup.rs new/pik-0.25.0/src/tui/components/help_popup.rs --- old/pik-0.24.0/src/tui/components/help_popup.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/tui/components/help_popup.rs 2025-06-29 15:23:08.000000000 +0200 @@ -31,7 +31,7 @@ .sorted() .map(|(key, bindings)| { Line::from(vec![ - Span::styled(format!("{:>KEY_PADDING$}: ", key), theme.primary), + Span::styled(format!("{key:>KEY_PADDING$}: "), theme.primary), Span::styled( bindings.iter().map(|b| b.to_string()).join(", "), theme.secondary, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/tui/components/process_details.rs new/pik-0.25.0/src/tui/components/process_details.rs --- old/pik-0.24.0/src/tui/components/process_details.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/tui/components/process_details.rs 2025-06-29 15:23:08.000000000 +0200 @@ -108,11 +108,11 @@ let ports = prc .ports .as_deref() - .map(|p| format!(" PORTS: {}", p)) + .map(|p| format!(" PORTS: {p}")) .unwrap_or("".to_string()); let parent = prc .parent_pid - .map(|p| format!(" PARENT: {}", p)) + .map(|p| format!(" PARENT: {p}")) .unwrap_or("".to_string()); vec![ Line::from(format!( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/tui/components/search_bar.rs new/pik-0.25.0/src/tui/components/search_bar.rs --- old/pik-0.24.0/src/tui/components/search_bar.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/tui/components/search_bar.rs 2025-06-29 15:23:08.000000000 +0200 @@ -20,7 +20,7 @@ search_area.set_cursor_line_style(theme.style); search_area.set_cursor_style(theme.cursor_style); search_area.insert_str(&initial_query); - let prompt = format!("{} ", prompt_icon); + let prompt = format!("{prompt_icon} "); Self { search_area, prompt_size: unicode_width::UnicodeWidthStr::width_cjk(prompt.as_str()) as u16, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/tui/components.rs new/pik-0.25.0/src/tui/components.rs --- old/pik-0.24.0/src/tui/components.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/tui/components.rs 2025-06-29 15:23:08.000000000 +0200 @@ -5,7 +5,7 @@ use super::LayoutRects; -pub mod fps_counter; +pub mod debug; pub mod general_input_handler; pub mod help_footer; pub mod help_popup; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pik-0.24.0/src/tui.rs new/pik-0.25.0/src/tui.rs --- old/pik-0.24.0/src/tui.rs 2025-06-13 09:52:07.000000000 +0200 +++ new/pik-0.25.0/src/tui.rs 2025-06-29 15:23:08.000000000 +0200 @@ -2,7 +2,7 @@ use anyhow::Result; use components::{ - Component, ComponentEvent, KeyAction, fps_counter::FpsCounter, + Component, ComponentEvent, KeyAction, debug::DebugComponent, general_input_handler::GeneralInputHandlerComponent, help_footer::HelpFooterComponent, help_popup::HelpPopupComponent, processes_view::ProcessesViewComponent, }; @@ -39,7 +39,7 @@ )), Box::new(GeneralInputHandlerComponent), Box::new(HelpFooterComponent::new(&app_settings.key_mappings)), - Box::new(FpsCounter::new()), + Box::new(DebugComponent::new()), Box::new(ProcessesViewComponent::new( &app_settings.ui_config, app_settings.filter_opions, @@ -149,7 +149,7 @@ pub top_bar: Rect, pub process_table: Rect, pub process_details: Rect, - pub fps_counter: Rect, + pub debug: Rect, pub help_text: Rect, } @@ -168,7 +168,7 @@ top_bar: rects[0], process_table: rects[1], process_details: rects[2], - fps_counter: footer[0], + debug: footer[0], help_text: footer[1], } } ++++++ vendor.tar.zst ++++++ /work/SRC/openSUSE:Factory/pik/vendor.tar.zst /work/SRC/openSUSE:Factory/.pik.new.27445/vendor.tar.zst differ: char 7, line 1
