swiftDialog / swiftDialog

Create user-notifications on macOS with swiftDialog
MIT License
546 stars 53 forks source link

Clicking Notification results in other dialog window closing #378

Closed BigMacAdmin closed 2 months ago

BigMacAdmin commented 3 months ago

Describe the bug If a user clicks a dialog notification, another dialog window is closed with exit code 0

To Reproduce Steps to reproduce the behavior:

  1. Run this example script, and click the notification while the dialog window is open
    
    #!/bin/bash
    #set -x

Dialog bug example

First call a notification...

/usr/local/bin/dialog --title "Bugs" --message "Better than snakes, I guess..." --notification

Now call a dialog window

/usr/local/bin/dialog --title "Bugs" --message "Better than snakes, I guess..." --icon "text=🐞" exitCode=$? echo "Exit code: $exitCode"

Observe that if the notification is clicked, the dialog window exits with code 0



**Expected behavior**
Clicking the notification should not close open dialog windows.

**Desktop (please complete the following information):**
 - macOS version `14.5`
 - swiftDialog version `2.4.2.4755` as well as `2.5.0.4758`
 - 
dan-snelson commented 3 months ago

@BigMacAdmin:

What if you used unique command files?

BigMacAdmin commented 3 months ago

@BigMacAdmin:

What if you used unique command files?

Does not appear to get around the issue

bartreardon commented 3 months ago

Ooh good catch. This is an issue in that every instance of dialog watches for notifications. I need to adjust so only instances activated by the notification service responds to notification actions.