Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 23935 - Text widget with Tree parent does not lose focus
Summary: Text widget with Tree parent does not lose focus
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux-Motif
: P2 major (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 2470
  Show dependency tree
 
Reported: 2002-09-20 16:13 EDT by Knut Radloff CLA
Modified: 2002-11-08 15:09 EST (History)
0 users

See Also:


Attachments
Test case (2.09 KB, text/plain)
2002-09-20 16:15 EDT, Knut Radloff CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Radloff CLA 2002-09-20 16:13:41 EDT
build 20020920

Run the attached code.
The left tree and text behave as they should on Windows and Linux. When you 
click anywhere in the tree the tree gets focus. Both widgets are children of 
the shell.
The right tree and text only work on Windows. On Linux the text never loses 
focus when you click on the tree. The text widget is a child of the tree.

This causes platform UI bug 2470. We can probably work around by creating the 
text editor as a sibling of the tree and moving it above the tree.
Comment 1 Knut Radloff CLA 2002-09-20 16:15:39 EDT
Created attachment 2031 [details]
Test case
Comment 2 Knut Radloff CLA 2002-09-20 16:32:46 EDT
Can't work around because the TreeEditor requites that the setEditor parameter 
be a child of the tree. The workaround works regardless on Windows (i.e., 
everything still looks and works right), even though the editor parameter is a 
sibling of the tree. On Linux the editor is not placed properly on top of the 
tree item label but otherwise works.
I'd like to either get this bug fixed or make the TreeEditor work with editors 
that are not children of the tree.
Comment 3 Steve Northover CLA 2002-09-23 09:10:34 EDT
Assigning to VI.  Note that there were weird focus issues on Motif involving "X 
hate when you assign focus to a parent window".  Ask me, Grant or SSQ.
Comment 4 Knut Radloff CLA 2002-10-25 13:06:44 EDT
Can I expect a fix for this soon, within the M3 timeframe?
This is blocking bug 2470 which is a P2. The goal is to fix all P2s for M3.
Comment 5 Veronika Irvine CLA 2002-10-28 08:55:48 EST
I will try to get around to it Knut.
We are working hard on the Mac right now to get it back on line. SO i can't 
give you an exact time.
Comment 6 Veronika Irvine CLA 2002-10-30 11:19:40 EST
Putting a force focus in the mouseDown method of Tree seems to do the trick.  
A similar thing was done in CTabFolder which is also capable of having 
children.

I need to continue to investigate if this is really the right way to go.
Comment 7 Knut Radloff CLA 2002-11-05 17:21:28 EST
Platform UI Bug 16577 seems to be related. I have not been able to create a SWT 
test case for it but the scenario is similar. 
The Platform UI TaskList creates a Text widget as a child of a Table widget. 
When you click the task list title bar setFocus is called on the Table. The 
Table never gets focus. Focus "bounces back" to the original widget, e.g., 
StyledText widget if you were in an editor before clicking the task list title 
bar. Focus transfers properly when I create the Text widget as a sibling of the 
Table.
In a test case, I create a Text widget as a child of a Table in a CTabFolder. 
When I set focus to the Table the Text widget gets focus which is different 
behavior from the TaskList.
Comment 8 Grant Gayed CLA 2002-11-08 15:09:11 EST
- Fixed > 1108 by implementing Veronika's suggestion
- I'll see if the underlying cause of bug 16577 is similar