From a8af6ce48e58fb52aec79170ba34c8ed56cef3dc Mon Sep 17 00:00:00 2001 From: mshafer1 <2565361+mshafer1@users.noreply.github.com> Date: Fri, 20 Dec 2024 15:53:22 -0600 Subject: [PATCH] if already visible, hide then show ideally, we would stack multiple up each with its own timeout and close event. For now, this just makes a pop up for the new message. --- ntfysh_client/NotificationDialog.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ntfysh_client/NotificationDialog.cs b/ntfysh_client/NotificationDialog.cs index fb69764..c94244d 100644 --- a/ntfysh_client/NotificationDialog.cs +++ b/ntfysh_client/NotificationDialog.cs @@ -32,6 +32,10 @@ namespace ntfysh_client public void ShowNotification(string title, string message, int timeout_ms = -1, ToolTipIcon? icon = null) { + if (this.IsVisible) + { + this.handleTimeout(null, null); + } this._icon = icon; if (this._icon != null) { @@ -83,7 +87,7 @@ namespace ntfysh_client this.Left = workingleft - NotificationDialog.ScreenMargin; } - private void ui_hide_window(object? sender, EventArgs e) + private void ui_hide_window(object? sender, EventArgs? e) { AnimateWindow( this.Handle, @@ -93,7 +97,7 @@ namespace ntfysh_client this.IsVisible = false; } - private void handleTimeout(object? sender, EventArgs e) + private void handleTimeout(object? sender, EventArgs? e) { if (this.timer != null) // check if the timer has already been disposed {