| Summary: | FocusIn/FocusOut events are sent when application switches, not just widgets. | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Doug M <eclipse> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | lshanmug, markus.kell.r, remy.suen, tonny.madsen |
| Version: | 4.2 | ||
| Target Milestone: | --- | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | stalebug | ||
|
Description
Doug M
With the current design you can still distinguish between the 2 cases by checking for the active shell using display.getActiveShell(). It returns null if no shell belonging to the currently running application is active. I think this can work for your scenario. A more specific statement of my UI's need is to distinguish between focusOut caused by shifting controls within a window from focusOut caused by switching to a different window OR app. You are right that these cases can be distinguished by using getActiveShell() and comparing it to ((Control) event.widget).getShell() in a focusOut listener. In OS X, the active shell has already changed either to the new shell or to null when focus leaves the active Control's window, therefore this method works. I am glad to be able to proceed past this issue, so thanks for your help. But you must see that this fragile kludge does not address the underlying issue. It's just as reasonable that the current shell would switch AFTER the control receives its focusOut event, even more reasonable, because the control may want to take some action while it and its window still have focus. And it cannot solve the corresponding issue of focusIn, where the active shell has already switched at focusIn, making it impossible for the control to distinguish the type of focus change when focus is gained. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. Dear Eclipse Genie, Thank you for automatically responding to the bug report that I filed in 2011, eight years ago. At this point, I have moved on to other interests. The desktop app I was working on in 2012 was a failure, due to numerous bugs in SWT's text handling (many of which could not be worked around), and the glacial responsiveness of SWT's developers to addressing them. I can truly say that choosing SWT over Swing for this project was the worst design decision I have ever made in my career. I am sure that SWT is highly tuned to the limited needs of Eclipse, but as a UI for general apps it is unfit for purpose. Thanks for listening, if anyone is. |