From accf30ec0b5af7ee3142dd8b7b0dd6f0cd3e4d3c Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 4 Aug 2024 11:34:38 -0400 Subject: [PATCH] ironbar: Update to latest commit Also patches an issue where Mullvad VPN would crash ironbar if the tray module was enabled. --- assets/ironbar-fix-tray-crash.patch | 25 +++++++++++++++++++++++++ overlays/ironbar.nix | 10 ++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 assets/ironbar-fix-tray-crash.patch diff --git a/assets/ironbar-fix-tray-crash.patch b/assets/ironbar-fix-tray-crash.patch new file mode 100644 index 00000000..2fef6ade --- /dev/null +++ b/assets/ironbar-fix-tray-crash.patch @@ -0,0 +1,25 @@ +From 2bc741d197867cd5f0c391b9532b4cf9c4d378f6 Mon Sep 17 00:00:00 2001 +From: Jake Stanger +Date: Sun, 4 Aug 2024 13:38:29 +0100 +Subject: [PATCH] fix(tray): crash when provided empty pixmap + +Fixes #675 +--- + src/modules/tray/icon.rs | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/modules/tray/icon.rs b/src/modules/tray/icon.rs +index c42ff4a5..87a77e50 100644 +--- a/src/modules/tray/icon.rs ++++ b/src/modules/tray/icon.rs +@@ -90,6 +90,10 @@ fn get_image_from_pixmap(item: &TrayMenu, size: u32) -> Result { + .and_then(|pixmap| pixmap.first()) + .ok_or_else(|| Report::msg("Failed to get pixmap from tray icon"))?; + ++ if pixmap.width == 0 || pixmap.height == 0 { ++ return Err(Report::msg("empty pixmap")); ++ } ++ + let mut pixels = pixmap.pixels.to_vec(); + + for i in (0..pixels.len()).step_by(4) { diff --git a/overlays/ironbar.nix b/overlays/ironbar.nix index cf7aa93d..42722bc3 100644 --- a/overlays/ironbar.nix +++ b/overlays/ironbar.nix @@ -1,19 +1,21 @@ final: prev: { ironbar = prev.ironbar.overrideAttrs (oldAttrs: rec { - version = "0.15.1-unstable-2024-07-13"; + version = "0.15.1-unstable-2024-08-04"; src = prev.fetchFromGitHub { owner = "JakeStanger"; repo = "ironbar"; - rev = "58190ab079d00dd53babb72346f1da6e1cc9ac72"; - hash = "sha256-Se+Pg81W8R+SFGFlhF1dU+NnMWSdLo3nC9TdPHa2IL4="; + rev = "92c690dcd14c21272f89bfde292546a2ee828e23"; + hash = "sha256-YFarQSZEIFpA1/9eRK4tm88mZYvWGIaAgCEAjazBO38="; }; + patches = (oldAttrs.patches or [ ]) ++ [ ../assets/ironbar-fix-tray-crash.patch ]; + cargoDeps = oldAttrs.cargoDeps.overrideAttrs ( prev.lib.const { name = "${oldAttrs.pname}-${version}-vendor.tar.gz"; inherit src; - outputHash = "sha256-VkSznG2REXNhUKEVWwqlfA7BF9zXC+fxTgNeRfYaHi4="; + outputHash = "sha256-wvjxKn2xS3qDJb7xVkLObr+Pz1djx+KHNSI66aonzpI="; } ); });