Community
Participate
Working Groups
build I20040323-0800 - new window in Java perspective - Window > Show View > Other > Team > Synchronize - no controls have focus Focus should be given to the view.
Must fix for M8.
This is fundamental to the workbench, and is important for accessibility.
This blocks Bug 54926.
this is only a problem on views that do not have any contents. I.e. Outline/syncrhonize
The problem is that ViewPane is hard coding the tab list to not include the title bar. This code should just be deleted. ViewPane /** * */ private void setTabList() { // Only include the ISV toolbar and the content in the tab list. // All actions on the System toolbar should be accessible on the pane menu. if (control.getContent() == null) { } else { // control.setTabList(new Control[] {control.getContent ()}); } }
There seems to be two problems here: 1. The view does not take focus initially. The view's setFocus() should be getting called, and the view should set focus to the appropriate control, even if the control does not show focus (e.g. a Label). 2. When a view does take focus, you can't tab out of it. This is the tabList regression. I have a fix for 2 I'm about to release to head. We should retest 1 with the fix and see if it has any impact.
Note: the previous comment was from me.
Fix released for part 2. Reassigning to Tod for part 1.
1) is being caused in this case by use saying page.getControl().setFocus() instead of page.getFocus(). I will be adding this too. Marking as fixed as the focus problem reported in this PR is fixed by my addition. Nick we did not pursue a more robust solution to the focus issue due to its complexity.
Does not appear to be fixed after all.
The general case is now fixed but there are some hard to replicate cases where this is still a problem. Marking post M8 as the main case is fixed.
Still a problem for the Console and Outline views. The fix above may have made this worse in the case where the PageBookView doesn't have a page yet. Before running any code, - close all perspectives - open resource perspective - close outline view - give focus to Navigator (with some content there) - Window > Show View > Outline using keyboard - Navigator still has focus - Window > Show View > Console using keyboard - Navigator still has focus
Traced through it. In the empty case, there is still a message page, whose label is being told to setFocus(). But this is a no-op because the label has SWT.NO_FOCUS style. I'm left wondering how this ever worked before. Steve, have their been any changes to the semantics of setFocus() in 3.0, particulary for controls that don't normally take focus?
It's worse than that: - with no editors open, package explorer and outline open - give focus to package explorer - click on outline view (either its tab or the label) - focus is still in the package explorer
Yesterday's fix did make the problem worse. The PageBookView.setFocus did: activeRec.page.getControl().setFocus(); it was changed to activeRec.page.setFocus(); The difference is that the former sets focus on the page's composite, the latter on the label. Composites force focus on themselves if none of their children take focus.
Yes, in 3.0, if you hook key events, you will get focus and participate in traversal. The SWT.NO_FOCUS (badly named) stops focus on mouse click. The 2.x behavior was inconsistent across platforms and didn't allow you to implement a "tool bar-like" Custom Control that took part in traversal and had keys for accessibility but didn't take focus with the mouse. Sorr\y..
Thanks for clarifying. The changes you describe are not the cause of the problems above.
Moving bacl to Nick
Released a fix to PageBookView and MessagePage.
Still a problem with the sync view in I20040407.
This appears to be fixed... care to verify Nick?
It does seem to be fixed now.