Although I can see there is subscription to NSWorkspaceSessionDidResignActiveNotification
and I also tried to add a subscription to NSWorkspaceWillPowerOffNotification,enforcing a rfbShutDown and a clean exit, the user cannot accomplish the logout/reboot.
At some point Mac OS pops up a message saying Vine is preventing it.
If you close the session or stop the listening server the logout/reboot will continue instantly.
I thought it might be because I am running it as a launch agent (just a guess) but I can see same behaviour when running it manually from the GUI session.
Are there any ideas of why it may happen ? I am happy to continue googling as of why the notifications don't work, but so far it turns out that the code already has implemented all bright suggestions (except for subscription to NSWorkspaceWillPowerOffNotification whihc I did with not much luck)
Although I can see there is subscription to NSWorkspaceSessionDidResignActiveNotification and I also tried to add a subscription to NSWorkspaceWillPowerOffNotification,enforcing a rfbShutDown and a clean exit, the user cannot accomplish the logout/reboot.
At some point Mac OS pops up a message saying Vine is preventing it.
If you close the session or stop the listening server the logout/reboot will continue instantly.
I thought it might be because I am running it as a launch agent (just a guess) but I can see same behaviour when running it manually from the GUI session.
Are there any ideas of why it may happen ? I am happy to continue googling as of why the notifications don't work, but so far it turns out that the code already has implemented all bright suggestions (except for subscription to NSWorkspaceWillPowerOffNotification whihc I did with not much luck)