Project: SWT
Bug 297477 Shell#setDefaultButton() does not save the default button under certain circumstances
Reported: 2009-12-10 09:01:27 | Status: resolved fixed

When a button is focused, it is set to the default button temporarily (at least in Windows, Decorations#setDefaultButton( Button, boolean ) is called from Button#WM_SETFOCUS with the second parameter set to false). When this very same button is then set as the default button, this new default button is not saved. As an effect, the previous default button is reinstalled when the focus changes. The reason for this is that the statement "saveDefault = defaultButton" is never reached if "button == defaultButton" is true in Decorations#setDefaultButton( Button, boolean ).

Files changed in fix:
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Decorations.java