Closed metaclam closed 4 months ago
The application doesn't foreground itself when a torrent is completed on Windows or Linux, so this is macOS specific (and unwanted, I presume) behaviour.
You can turn off notifications by unchecking Tools > Application options > Show notifications in tray icon
. This is enabled by default.
Can't reproduce on Big Sur, will try Sonoma once I get around to installing it.
Sorry, this appears to be standard Lazarus behaviour on macOS. I reproduced this on Big Sur too.
I created a very simple application that shows a window and starts a 10-second timer. When the timer interval elapses, a notification is shown by using TTrayIcon.ShowBalloonHint
, the same function that transgui uses. After starting the application and letting it run in the background, it foregrounds itself after 10 seconds when the pop-up is shown.
Here's the Lazarus bug report : https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/41016
A proper fix for this would be to use the macOS APIs for delivering notifications but given my total lack of experience with macOS and ObjC/Pascal bindings, I'm not signing up for that. The Lazarus wiki has some example code, but it uses the API that was deprecated in macOS 11.
Great news, the bug report was picked up by a Lazarus developer who implemented support for native notifications on macOS. This means that notifications are now going to look like this :
(don't pay attention to the icon as this was running in a makeshift AppBundle)
In line with standard macOS behaviour, you will need to allow displaying notifications from transgui when it first tries to display one :
It should also be possible to block notifications in system settings instead of just in the application itself. Of course, the application's main window is no longer brought to the foreground.
I will close this ticket once I integrate the new Lazarus code into my own fork and first transgui builds with this feature are available.
Tested on Intel Big Sur, Intel Sonoma, and M1 Monterey.
Maybe I'm missing a setting, but can we turn off the notification for completed torrents? Can we at least not have the app foreground itself when a torrent is completed?
On MacOS Sonoma.