From 245715fccdac7a440a5a58962ba380e5a11a5d22 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Wed, 27 Mar 2013 15:53:28 -0400 Subject: Bug 403559 - Intermittent loss of caret (or cursor?) --- .../win32/org/eclipse/swt/ole/win32/OleControlSite.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java index 504eebf0b8..ccb511c64c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleControlSite.java @@ -710,14 +710,14 @@ void onFocusOut(Event e) { lpgui1.cbSize = GUITHREADINFO.sizeof; OS.GetGUIThreadInfo(threadId, lpgui1); objIOleInPlaceObject.UIDeactivate(); + if (SWT_RESTORECARET == 0) { + SWT_RESTORECARET = OS.RegisterWindowMessage (new TCHAR (0, "SWT_RESTORECARET", true)); + } if (lpgui1.hwndCaret != 0) { GUITHREADINFO lpgui2 = new GUITHREADINFO(); lpgui2.cbSize = GUITHREADINFO.sizeof; OS.GetGUIThreadInfo(threadId, lpgui2); if (lpgui2.hwndCaret == 0 && lpgui1.hwndCaret == OS.GetFocus()) { - if (SWT_RESTORECARET == 0) { - SWT_RESTORECARET = OS.RegisterWindowMessage (new TCHAR (0, "SWT_RESTORECARET", true)); - } /* * If the caret was not restored by SWT, put it back using * the information from GUITHREADINFO. Note that this will @@ -733,6 +733,9 @@ void onFocusOut(Event e) { } } } + if (lpgui1.hwndFocus != 0 && lpgui1.hwndFocus == OS.GetFocus()) { + OS.SendMessage (lpgui1.hwndFocus, SWT_RESTORECARET, 0, 0); + } } private int OnFocus(int fGotFocus) { return COM.S_OK; -- cgit