Discussion:
too bugs found while moving focus on IME mode on between two scite instances
(too old to reply)
johnsonj
2014-07-07 01:30:01 UTC
Permalink
According to neils comments I have tested my korean IME on two scite
instances.
I have found two bugs on th while.

Run two scite instances.
Turn hangul mode on.

One problem belongs to scintilla: the focus goes astray.
Try move focus between the two instances or onto other window,
then the focus goes astray. It is not as expected.
The fix for this problem follows.
----------------------------------------------------------------
case WM_KILLFOCUS: {
HWND wOther = reinterpret_cast<HWND>(wParam);
HWND wThis = MainHWND();
HWND wCT = reinterpret_cast<HWND>(ct.wCallTip.GetID());
if (!wParam ||
!(::IsChild(wThis, wOther) || (wOther == wCT))) {
SetFocusState(false);
DestroySystemCaret();
}
HIMC hIMC = ImmGetContext(MainHWND()); //by johnsonj for
correct focus moving
if(hIMC) { //
copied from case "WM_LBUTTONDOWN"
::ImmNotifyIME( hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE,
0 );
::ImmReleaseContext(MainHWND(), hIMC);
}
break;
}
-------------------------------------------------------------------------------------------------------------

Another problem belongs to "on the spot IME": the composition window
happens to be displayed.
type in some hangul letters while moving focus between the two instances.
try quickly over and over again.
it happens to display the composition window.
it will be fixed by this code.
It requires "on the spot IME". never use for "over the spot IME"
-------------------------------------------------------------------------------------------------
case WM_IME_SETCONTEXT: { //by johnsonj
bool koreanIME = (InputCodePage() == 949 || InputCodePage()
== 1361);
if (koreanIME) {
if (wParam) {
LPARAM NoImeWin = lParam;
NoImeWin = NoImeWin &
(~ISC_SHOWUICOMPOSITIONWINDOW);
return ::DefWindowProc(MainHWND(), iMessage,
wParam, NoImeWin);
}
}
}
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Neil Hodgson
2014-07-10 00:33:26 UTC
Permalink
Post by johnsonj
One problem belongs to scintilla: the focus goes astray.
Try move focus between the two instances or onto other window,
then the focus goes astray. It is not as expected.
The fix for this problem follows.
----------------------------------------------------------------
case WM_KILLFOCUS: {
HWND wOther = reinterpret_cast<HWND>(wParam);
HWND wThis = MainHWND();
HWND wCT = reinterpret_cast<HWND>(ct.wCallTip.GetID());
if (!wParam ||
!(::IsChild(wThis, wOther) || (wOther == wCT))) {
SetFocusState(false);
DestroySystemCaret();
}
HIMC hIMC = ImmGetContext(MainHWND()); //by johnsonj for correct focus moving
if(hIMC) { // copied from case "WM_LBUTTONDOWN"
::ImmNotifyIME( hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0 );
::ImmReleaseContext(MainHWND(), hIMC);
}
break;
}
That appears to be a safe change and could help in other circumstances so it has been committed as
https://sourceforge.net/p/scintilla/code/ci/4ad0660abee971e9eeaa96adf96e5d7af676d14d/
It is credited to "johnsonj". The credits list can handle non-ASCII so if you'd prefer a different name in the credits then tell me.
Post by johnsonj
-------------------------------------------------------------------------------------------------------------
Another problem belongs to "on the spot IME": the composition window happens to be displayed.
type in some hangul letters while moving focus between the two instances.
try quickly over and over again.
it happens to display the composition window.
it will be fixed by this code.
It requires "on the spot IME". never use for "over the spot IME"
------------------------------------------------------------------------------------------------
Since this appears dependent on your other changes, it shouldn't be included until the rest of the Korean IME changes are.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...