mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
MacOs enhanced support #619
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @danatcofo on GitHub (Jan 16, 2021).
There are at least 2 different MacOs targeted features that are missing which are kind of important to a fully functioning app.
app.on('activate')event that indicates a dock click. the activate event also is fired off for other events but for the purposes of Electron.NET, the dock click is the primary missing feature. Without this its impossible to know when the dock icon has been clicked and no windows are open.I'm planning to implement these myself and create a pr for them, but wanted to open up this feature as a handle to gather any other major macOS interactions that are missing.
@danatcofo commented on GitHub (Jan 18, 2021):
@GregorBiswanger I've got this working locally, I'll have a PR in to support this today or tomorrow at some point as soon as I get all my T's dotted and I's crossed.
Some things of interest here I'm doing to put support in for this I'll make note of.
Dock.setMenu() is a straight forward port of what you do elsewhere and is tested in mac
Support for
activateevent I'm accomplishing by adding a genericOn()andOnce()method to the App and Tray modules. I combed through the Electron docs looking for places where events are exposed and those two places seem to be the only places where support isn't already in place for the available events in every case.for example:
Registering the
activateevent and consuming itThe app.ts and tray.ts are implemented to return the second argument of the args list as the first argument is an event object and the second argument is a data object if it exists. This falls in line with the pattern that you have put together elsewhere of having a single object being the argument.
This is not intended to cover all scenarios we might have but it certainly opens up the project to all consumers to target things that are not covered more easily.