| Summary: | [Forms] Click on hyperlink in FormText fails | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Stefan Mücke <s.muecke> | ||||
| Component: | User Assistance | Assignee: | Adam Archer <agarcher> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | agarcher | ||||
| Version: | 3.4 | ||||||
| Target Milestone: | 3.4.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
I have discovered that this is a regression since 3.3. It was caused by the fix for bug 178557. Due to unrelated problems, that fix is going to be rolled back for 3.5 and a different approach will be taken to solve it (see bug 236735 for details). That will solve this bug in the 3.5 stream. However, since this is a regression since 3.3, we should also solve it for 3.4.1. I have a very simple solution in mind that will not affect the integrity of the fix for bug 178557. Created attachment 105224 [details]
patch for 3.4.1
Patch applied to 3.4.1 branch. Fix for 3.5 will be tracked in bug 236735. |
Build ID: I20071213-1700 Eclipse 3.4 M4 When a hyperlink in a FormText is clicked, it fails when the FormText is not completely visible and does not have the focus. Steps to reproduce: - Open any .java file in Eclipse - Press F1 to open the help view and go to the "Related topics" page - Make sure that the top-most item of the "See also" items is not visible (resize the view so that not all items do fit; move the above or below another view to change its height) - Scroll to the bottom of the "See also" items list - Set focus on the Java editor again - Click on any item in the "See also" list - Result: the clicked link is not activated (executed), but instead FormText scrolls to the top and selects the top-most link Problem description: The mouse click causes three events: - setFocus - mouseDown - mouseUp The events are fired in this order. The setFocus event comes first; it causes the first hyperlink in FormText to be selected. Since this hyperlink is not visible, it will be scrolled visible. Then the mouseDown event is handled. The mouse coordinates are those that caused the setFocus event. Thus they refer to the position before the FormText was scrolled, so that the correct link is selected. Finally, the mouseUp event occurs. This event is fired after the scrolling took place, so that the coordinates are different from those of the mouseDown event. No link activation is recognized. FormText already contains code that is supposed to handle focus gain caused by a mouse click. The FocusListener in FormText checks the field 'mouseFocus' to handle the mouse focus. This field is supposed to be set to true when a 'mouseDown' event occurs. The problem, however, is that the setFocus event is always handled before the mouseDown event, and therefore mouseDown will always be false at this time. The processing order of the events cannot be changed, because WM_MOUSEACTIVATE comes before WM_LBUTTONDOWN (on Windows). Solution idea: - disable scrolling on focusGained event (do not call method ensureVisible(...) in method handleFocusChange() ) - call ensureVisible(...) only when a traverse event is processed