aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZufu Liu <unknown>2020-01-06 23:14:29 +1100
committerZufu Liu <unknown>2020-01-06 23:14:29 +1100
commit6be5feeb0635f4b0c51cb59b2b4eacfb9efda69f (patch)
treea6f90068a285b8d716ee19ddb03170cdf14f116a
parentfecdeef26e29f36b9a81084a0fcfac3fd0bcd335 (diff)
downloadscintilla-mirror-6be5feeb0635f4b0c51cb59b2b4eacfb9efda69f.tar.gz
Bug [#2135]. Improve location of candidate window.
-rw-r--r--doc/ScintillaHistory.html1
-rwxr-xr-xgtk/ScintillaGTK.cxx6
2 files changed, 5 insertions, 2 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 39e82ef33..f210d64eb 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -599,6 +599,7 @@
<li>
Improve IME behaviour on GTK.
Set candidate position for windowed IME.
+ Improve location of candidate window.
<a href="https://sourceforge.net/p/scintilla/bugs/2135/">Bug #2135</a>.
</li>
</ul>
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index c02c07365..33313b264 100755
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -2315,8 +2315,10 @@ void ScintillaGTK::SetCandidateWindowPos() {
// Composition box accompanies candidate box.
const Point pt = PointMainCaret();
GdkRectangle imeBox = {0}; // No need to set width
- imeBox.x = static_cast<gint>(pt.x); // Only need positiion
- imeBox.y = static_cast<gint>(pt.y) + vs.lineHeight; // underneath the first charater
+ imeBox.x = static_cast<gint>(pt.x);
+ imeBox.y = static_cast<gint>(pt.y + std::max(4, vs.lineHeight/4));
+ // prevent overlapping with current line
+ imeBox.height = vs.lineHeight;
gtk_im_context_set_cursor_location(im_context, &imeBox);
}