diff options
-rw-r--r-- | doc/ScintillaHistory.html | 6 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index f0a419e09..bde4d4408 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -566,6 +566,12 @@ <li> SciTE enables use of SCI_ commands in user.context.menu. </li> + <li> + On Win32, stop the IME candidate window moving unnecessarily and position it better.<br /> + Stop candidate window overlapping composition text and taskbar.<br /> + <a href="https://sourceforge.net/p/scintilla/bugs/2120/">Bug #2120</a>. + <a href="https://sourceforge.net/p/scintilla/feature-requests/1300/">Feature #1300</a>. + </li> </ul> <h3> <a href="https://www.scintilla.org/scite420.zip">Release 4.2.0</a> diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index ec9cb5498..459d926b1 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -940,11 +940,17 @@ void ScintillaWin::SetCandidateWindowPos() { IMContext imc(MainHWND()); if (imc.hIMC) { const Point pos = PointMainCaret(); - CANDIDATEFORM CandForm; + const PRectangle rcClient = GetTextRectangle(); + CANDIDATEFORM CandForm{}; CandForm.dwIndex = 0; - CandForm.dwStyle = CFS_CANDIDATEPOS; + CandForm.dwStyle = CFS_EXCLUDE; CandForm.ptCurrentPos.x = static_cast<int>(pos.x); CandForm.ptCurrentPos.y = static_cast<int>(pos.y + vs.lineHeight); + // Exclude the area of the whole caret line + CandForm.rcArea.top = static_cast<int>(pos.y); + CandForm.rcArea.bottom = static_cast<int>(pos.y + vs.lineHeight); + CandForm.rcArea.left = static_cast<int>(rcClient.left); + CandForm.rcArea.right = static_cast<int>(rcClient.right); ::ImmSetCandidateWindow(imc.hIMC, &CandForm); } } |