Skip to main content

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

Hi Stephan -

We had a look at the patch on the bug and the idea, at first glance, seems reasonable. We're not sure if Activate is the right event to send out as it's a Shell event and, in this scenario, it's being sent from Display. We might need to come up with another event type for this use case. I've targeted the bug to our next milestone, so we'll see what we can do.

- B


From: Stephan Aßmus <superstippi@xxxxxx>
To: "Eclipse Platform SWT component developers list." <platform-swt-dev@xxxxxxxxxxx>
Date: 12/12/2012 06:53 AM
Subject: [platform-swt-dev] Send SWT.Activate event in Display when user        clicks icon in MacOS Dock
Sent by: platform-swt-dev-bounces@xxxxxxxxxxx





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="">

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



_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev




Back to the top