From 26c17d5cf9bf6ba47e03b212e3cf1db2233d34c0 Mon Sep 17 00:00:00 2001 From: electria Date: Fri, 31 Jul 2026 11:14:05 -0700 Subject: [PATCH 1/2] docs: add safety note --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main.rs b/src/main.rs index 3e65e8d..5ad2bf3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -189,6 +189,18 @@ impl State { widget::image::allocate(widget::image::Handle::from_rgba( image.width(), image.height(), + // SAFETY: this is a sort of race condition; + // will cause panics with large enough images, + // when they are edited consecutively. + // + // this can be reproduced by holding down 'i' with a 10k by 10k px image, + // which will invert the colors rapidly and eventually crash the app. + // + // however, that is not such a problem in this case, + // and I don't know a different way of doing this that doesn't copy + // (performance loss, which is can be pretty big) + // or likely cause flickering instead in such cases + // (like using Handle over Allocation to immediately drop the last one) unsafe { std::mem::transmute::<&[u8], &'static [u8]>(image.as_bytes()) }, )) .map(Message::ImageDisplayReady) From 754dd6126d0937819482a89e5ec2185d36ff239d Mon Sep 17 00:00:00 2001 From: electria Date: Fri, 31 Jul 2026 11:21:37 -0700 Subject: [PATCH 2/2] fix: wrong dbus output (?) --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 40636f4..d7fa343 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,7 @@ dlDeps = with pkgs; [ # libdbus, for rfd - dbus + dbus.lib # needed for both x11 and wayland libxkbcommon