Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324182

Summary: [find/replace] (Shift+)Enter should always execute the current default button
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: TextAssignee: Rajesh <rthakkar>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, deepakazad
Version: 3.7Flags: markus.kell.r: review+
Target Milestone: 3.7 M2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix
none
Fix markus.kell.r: iplog+

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.