Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324182 - [find/replace] (Shift+)Enter should always execute the current default button
Summary: [find/replace] (Shift+)Enter should always execute the current default button
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M2   Edit
Assignee: Rajesh CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-01 08:05 EDT by Markus Keller CLA
Modified: 2010-09-14 16:03 EDT (History)
2 users (show)

See Also:
markus.kell.r: review+


Attachments
Fix (1.39 KB, patch)
2010-09-02 14:06 EDT, Rajesh CLA
no flags Details | Diff
Fix (1.44 KB, patch)
2010-09-03 01:24 EDT, Rajesh CLA
markus.kell.r: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2010-09-01 08:05:49 EDT
I20100831-1001, follow-up to bug 27996

When one of the other 4 push buttons in the Find/Replace dialog has focus (i.e. not the Find button and not any other control), Windows considers the focused button as temporary default button. But in HEAD, when I tab to the Close button and then press (Shift+)Enter, the find action is executed. The special code for (Shift+)Enter handling should not be active in that case.
Comment 1 Markus Keller CLA 2010-09-02 10:05:14 EDT
> Windows considers the focused button as temporary default button.

Note that this is *not* the case on Mac OS X. There, the default button stays the default, so the current behavior would actually be correct on that platform.

Please check if you can find out the temporary default button on Windows via SWT APIs. If you can't, I think we should use Util.isMac() and keep the current behavior on that platform.
Comment 2 Rajesh CLA 2010-09-02 14:06:14 EDT
Created attachment 178075 [details]
Fix

I couldn't find a way in SWT to lookup the 'temporary default' button.
The attached fix works on GTK and Windows.
Comment 3 Rajesh CLA 2010-09-03 01:24:27 EDT
Created attachment 178119 [details]
Fix

Added one more check.
Comment 4 Markus Keller CLA 2010-09-07 09:44:44 EDT
The check for "!fFindNextButton.isFocusControl()" is unnecessary. Removed that, removed unnecessary parentheses, and committed to HEAD.
Comment 5 Deepak Azad CLA 2010-09-14 16:03:18 EDT
Verified for 3.7M2 on Linux with I20100914-0100.