From a7b7c104749a67eae9b422fbd25608ebda0ffcd7 Mon Sep 17 00:00:00 2001 From: Leah Amelia Chen Date: Tue, 22 Jul 2025 16:43:35 +0000 Subject: [PATCH] gtk: only show clipboard toast when content isn't empty --- src/apprt/gtk/Surface.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index 43e378487..159b3df54 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -1259,9 +1259,13 @@ pub fn setClipboardString( // We only toast if we are copying to the standard clipboard. if (clipboard_type == .standard and self.app.config.@"app-notifications".@"clipboard-copy") - { - if (self.container.window()) |window| - window.sendToast(i18n._("Copied to clipboard")); + toast: { + const window = self.container.window() orelse break :toast; + + if (val.len > 0) + window.sendToast(i18n._("Copied to clipboard")) + else + window.sendToast(i18n._("Cleared clipboard")); } return; }