diff options
| author | Zufu Liu <unknown> | 2020-01-06 23:14:29 +1100 |
|---|---|---|
| committer | Zufu Liu <unknown> | 2020-01-06 23:14:29 +1100 |
| commit | 25b829a0ba90b6c8915b2f71a155e54dc20cb43a (patch) | |
| tree | 682acb77dfb871441edc46f7cf8eb2ca6e6caac0 | |
| parent | 699493532003ed35e10075a58e3a2761d9d8f6f2 (diff) | |
| download | scintilla-mirror-25b829a0ba90b6c8915b2f71a155e54dc20cb43a.tar.gz | |
Backport: Bug [#2135]. Improve location of candidate window.
Backport of changeset 7948:be6757890988.
| -rw-r--r-- | doc/ScintillaHistory.html | 1 | ||||
| -rwxr-xr-x | gtk/ScintillaGTK.cxx | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 3c8172f40..8a605f179 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -586,6 +586,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 144942fe8..5b0c9b940 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -2314,8 +2314,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); } |
