Bug 229839 - [CCombo] two focusIn event fired when tabbing into a CCombo
Summary: [CCombo] two focusIn event fired when tabbing into a CCombo
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Praveen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-01 14:31 EDT by Duong Nguyen CLA
Modified: 2019-09-06 15:29 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (1.42 KB, patch)
2009-04-13 05:39 EDT, Praveen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Duong Nguyen CLA 2008-05-01 14:31:57 EDT
When you use the tab key to traverse the widgets, the CCombo fires two focusIn events when it has focus.
Comment 1 Duong Nguyen CLA 2008-05-16 14:37:34 EDT
This also happens on Linux gtk.
You must hook both the key listener and the focus listener to see the multiple focus-in.
Comment 2 Bogdan Gheorghe CLA 2008-11-24 20:11:21 EST
Praveen, try to understand why there are two events coming in here.
Comment 3 Praveen CLA 2009-04-13 05:39:07 EDT
Created attachment 131629 [details]
Proposed patch

During the tab traversal, the method traverseGroup() is responsible for traversing the focus to the next widget in the order. During this function, it checks whether key listeners are hooked to that widget and if so, focus is traversed to that widget.
As CCombo is hooked with key listeners, we request to set the focus onto CCombo. Further, CCombo receives a FocusIn event(FocusGained is called on CCombo). While handling this event by CCombo, it actually assigns the focus to the Text widget contained in it(FocusLost is called on CCombo and FocusGained on Text widget contained by CCombo). Thus, extra FocusIn and FocusOut events are received by CCombo.
The fix is to make sure that focus should not be set directly on CCombo when key listeners are hooked on it, rather the focus should be set on the text widget contained by CCombo.
Comment 4 Eclipse Webmaster CLA 2019-09-06 15:29:54 EDT
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.