diff options
author | Silenio Quarti <silenio> | 2008-05-28 20:55:15 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2008-05-28 20:55:15 +0000 |
commit | 3a3b000b99cbce518a33fdb9f12963c362140bb5 (patch) | |
tree | a02fabab668ee0075b232c3392896055f924155e | |
parent | 73a84b5055a6e8b9d3988630057727bfa99b8f45 (diff) | |
download | eclipse.platform.swt-3a3b000b99cbce518a33fdb9f12963c362140bb5.tar.gz eclipse.platform.swt-3a3b000b99cbce518a33fdb9f12963c362140bb5.tar.xz eclipse.platform.swt-3a3b000b99cbce518a33fdb9f12963c362140bb5.zip |
234158 - StyledText should stop blinking caret when losing focus in verify key listener
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java index a5e9ddb58b..2e52b3a9e4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java @@ -2241,24 +2241,27 @@ int kEventTextInputUnicodeForKeyEvent (int nextHandler, int theEvent, int userDa * send the event to the original focus widget and stop * the chain of handlers. */ - if (!isDisposed () && !hasFocus ()) { + if (!isDisposed ()) { Control focusControl = display.getFocusControl (); - int focusHandle = focusHandle (); - int window = OS.GetControlOwner (focusHandle); - display.ignoreFocus = true; - OS.SetKeyboardFocus (window, focusHandle, (short) focusPart ()); - display.ignoreFocus = false; - result = OS.CallNextEventHandler (nextHandler, theEvent); - if (focusControl != null) { - focusHandle = focusControl.focusHandle (); - window = OS.GetControlOwner (focusHandle); + if (focusControl != this) { + int window = OS.GetControlOwner (handle), newWindow = 0; + if (focusControl != null) { + newWindow = OS.GetControlOwner (focusControl.handle); + } display.ignoreFocus = true; - OS.SetKeyboardFocus (window, focusHandle, (short) focusControl.focusPart ()); + if (window != newWindow) OS.SetUserFocusWindow (window); + OS.SetKeyboardFocus (window, focusHandle (), (short) focusPart ()); display.ignoreFocus = false; - } else { + result = OS.CallNextEventHandler (nextHandler, theEvent); display.ignoreFocus = true; - OS.ClearKeyboardFocus (window); + if (window != newWindow && newWindow != 0) OS.SetUserFocusWindow (newWindow); + if (window == newWindow && focusControl != null) { + OS.SetKeyboardFocus (window, focusControl.focusHandle (), (short) focusControl.focusPart ()); + } else { + OS.ClearKeyboardFocus (window); + } display.ignoreFocus = false; + return OS.noErr; } } return result; |