Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] Send SWT.Activate event in Display when user clicks icon in MacOS Dock

Hi,

in my application I implement not quitting when the user closes the last document window. SWT 3.7 introduced Display.getMenuBar() where one can install menu items and it made this behavior feasible.

Now I wanted to react to the user clicking the application icon in the Dock when no windows are shown. My intuitive idea was to register a Listener for SWT.Activate on the Display. That didn't work and I googled around a bit. I found out that the Azureus project has an enhanced version of the CocoaUIEnhancer originating from Eclipse which also deals with this problem. However, I was unsuccessful to port their changes to my version of CocoaUIEnhancer. I have no clue why it doesn't work, maybe my application is not considered to have no windows and never receives the event in the first place.

Then I found out there is an open SWT bug, and it has a patch ready to be applied:

https://bugs.eclipse.org/bugs/attachment.cgi?id=222761&action=diff

With this patch, my first idea would have gotten me right to the solution. Would there be any arguments against handling the event like this?

Best regards,
-Stephan





Back to the top