Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368940 - [Shell] Prevent application from having no active shells
Summary: [Shell] Prevent application from having no active shells
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.5 M7   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 06:32 EST by Tim Buschtoens CLA
Modified: 2012-04-03 12:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Buschtoens CLA 2012-01-18 06:32:53 EST
Using RWT.ACTIVE_KEYS and event filter to get all strokes for certain keys doesnt work if the document background is focused, i.e. no control is focused. What happens that the request IS sent with "w1" (display) as the target, but the server doesnt seem to process it.
Comment 1 Ralf Sternberg CLA 2012-01-18 07:27:11 EST
After a discussion with Ivan, we came to the conclusion that this case will likely never happen in SWT.  An application will only receive events from the OS if one of it's shells has the keyboard focus.  There seem to be two ways to solve this issue:

a) be consistent with SWT and don't send any requests when no control is focused / no shell is active.  In this case the last active shell would have to be deactivated.  Currently, it stays active (title bar has blue background).

b) prevent the last active shell from being deactivated by clicking on the document.  As long as a shell is active, there should always be a focus control (a control or the shell itself).

I'm in favor of b).
Comment 2 Tim Buschtoens CLA 2012-02-17 05:30:41 EST
b)
Comment 3 Ivan Furnadjiev CLA 2012-02-17 09:22:58 EST
+1 for b) too.
Comment 4 Tim Buschtoens CLA 2012-04-03 11:36:29 EDT
The Shell is actually still active, it's just the focus that is now on the ClientDocument. I will fix this by changing the EventHandler.js to not set focus if ClientDocument has been clicked.
Comment 5 Tim Buschtoens CLA 2012-04-03 12:09:12 EDT
Fixed in CVS HEAD as described above.

Note that this is not the ideal solution. The document can still be focused in theory, just not by mouse (and probably not in practise). The best fix would have been to make ClientDocument explicitly non-focusable, which would require to deactivate it as a focus-root, and that would break a lot of test.