From 071af976dafcf59d64de91989607ba1fb58592c9 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Jul 2019 15:29:06 +1000 Subject: Bug [#2120]. Avoid candidate window obscuring text when near bottom of screen. Feature [feature-requests:#1300] part 1. --- doc/ScintillaHistory.html | 6 ++++++ 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 @@
  • SciTE enables use of SCI_ commands in user.context.menu.
  • +
  • + On Win32, stop the IME candidate window moving unnecessarily and position it better.
    + Stop candidate window overlapping composition text and taskbar.
    + Bug #2120. + Feature #1300. +
  • Release 4.2.0 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(pos.x); CandForm.ptCurrentPos.y = static_cast(pos.y + vs.lineHeight); + // Exclude the area of the whole caret line + CandForm.rcArea.top = static_cast(pos.y); + CandForm.rcArea.bottom = static_cast(pos.y + vs.lineHeight); + CandForm.rcArea.left = static_cast(rcClient.left); + CandForm.rcArea.right = static_cast(rcClient.right); ::ImmSetCandidateWindow(imc.hIMC, &CandForm); } } -- cgit v1.2.3