Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Tue, 24 Mar 2020 19:34:44 UTC Commit: af48b3160668e7f183d358364fe6b396f5df4b9c https://github.com/geany/geany-osx/commit/af48b3160668e7f183d358364fe6b396f5...
Log Message: ----------- Use 'quartz' as the default IM module
Since we are using the latest GTK release which fixes page up/down when IM is enabled and since the latest patches to Scintilla fixes most of the problems with IM, it should be safe to use quartz by default.
Modified Paths: -------------- Launcher/geany/geany/main.m geany.modules patches/02-geany_scintilla_im_fix.patch
Modified: Launcher/geany/geany/main.m 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -186,7 +186,7 @@ static int run_geany() { config = @{ THEME_KEY: [ConfigValue valueWithDefault:@"0" comment:@"0: automatic selection based on system settings (requires Geany restart when changed, macOS 10.14+); 1: light; 2: dark; make sure there's no ~/.config/gtk-3.0/settings.ini file, otherwise it overrides the settings made here"], LOCALE_KEY: [ConfigValue valueWithDefault:@"" comment:@"no value: autodetect; locale string: locale to be used (e.g. en_US.UTF-8)"], - IM_MODULE_KEY: [ConfigValue valueWithDefault:@"" comment:@"no value: don't use any IM module; module name: use the specified module, e.g. 'quartz' for native macOS behavior (slightly buggy so not enabled by default), for complete list of modules see Geany.app/Contents/Resources/lib/gtk-3.0/3.0.0/immodules, use without the 'im-' prefix"], + IM_MODULE_KEY: [ConfigValue valueWithDefault:@"quartz" comment:@"no value: don't use any IM module; module name: use the specified module, e.g. 'quartz' for native macOS behavior, for complete list of modules, see Geany.app/Contents/Resources/lib/gtk-3.0/3.0.0/immodules, use without the 'im-' prefix"], };
read_config();
Modified: geany.modules 4 lines changed, 2 insertions(+), 2 deletions(-) =================================================================== @@ -105,7 +105,7 @@ <!-- This patch corresponds to https://github.com/geany/geany/pull/2363 --> <patch file="https://github.com/geany/geany-osx/raw/master/patches/01-geany_config_shell.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/patches/03-geany_vte_login_shell.patch" strip="1" /> - <!-- TODO: remove once merged upstream--> + <!-- TODO: remove once Geany updates to the latest Scintilla --> <patch file="https://github.com/geany/geany-osx/raw/master/patches/02-geany_scintilla_im_fix.patch" strip="1" /> </branch> <dependencies> @@ -123,7 +123,7 @@ <!-- This patch corresponds to https://github.com/geany/geany/pull/2363 --> <patch file="https://github.com/geany/geany-osx/raw/master/patches/01-geany_config_shell.patch" strip="1" /> <patch file="https://github.com/geany/geany-osx/raw/master/patches/03-geany_vte_login_shell.patch" strip="1" /> - <!-- TODO: remove once merged upstream--> + <!-- TODO: remove once Geany updates to the latest Scintilla --> <patch file="https://github.com/geany/geany-osx/raw/master/patches/02-geany_scintilla_im_fix.patch" strip="1" /> </branch> <dependencies>
Modified: patches/02-geany_scintilla_im_fix.patch 92 lines changed, 65 insertions(+), 27 deletions(-) =================================================================== @@ -1,38 +1,76 @@ # HG changeset patch -# User Jiří Techet techet@gmail.com -# Date 1571822802 -7200 -# Wed Oct 23 11:26:42 2019 +0200 -# Node ID 46e1cd396ba57332ec81628c7365bfc91ed207e1 -# Parent 4f8c3b19095af4f0d333f1b6aa1ff1e3a69d9f4c -Call SetCandidateWindowPos() inside PreeditChanged() +# User Zufu Liu +# Date 1578312404 -39600 +# Mon Jan 06 23:06:44 2020 +1100 +# Node ID 9d42a88f08cc4d336ecdb0c7f1587efdb00bddbe +# Parent 4dad3058a47731d1f90d09341e546465170fa40f +Bug [#2135]. Set candidate window position in windowed IME mode.
-On macOS it is possible to long-press a key to get a popup offering to -select characters with additional accents. This popup should appear -at the position of the caret. Scintilla however only sets the -caret position using gtk_im_context_set_cursor_location() for some -input methods (which exclude im-quartz) so the caret position isn't -set correctly and macOS always displays the popup at the very bottom -of the screen. +diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx +--- a/gtk/ScintillaGTK.cxx ++++ b/gtk/ScintillaGTK.cxx +@@ -2432,6 +2432,8 @@ + try { + PreEditString pes(im_context); + if (strlen(pes.str) > 0) { ++ SetCandidateWindowPos(); ++ + PangoLayout *layout = gtk_widget_create_pango_layout(PWidget(wText), pes.str); + pango_layout_set_attributes(layout, pes.attrs); + +# HG changeset patch +# User Zufu Liu +# Date 1578312869 -39600 +# Mon Jan 06 23:14:29 2020 +1100 +# Node ID be67578909888e76e81421d32459ace2a59b9d1d +# Parent 9d42a88f08cc4d336ecdb0c7f1587efdb00bddbe +Bug [#2135]. Improve location of candidate window.
-Moving SetCandidateWindowPos() into PreeditChanged() seems to fix -the problem. +diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx +--- a/gtk/ScintillaGTK.cxx ++++ b/gtk/ScintillaGTK.cxx +@@ -2315,8 +2315,10 @@ + // 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); + } + +# HG changeset patch +# User Zufu Liu +# Date 1578313229 -39600 +# Mon Jan 06 23:20:29 2020 +1100 +# Node ID 59f3c5ced2e22c4ab05082ada5cd356e13c16633 +# Parent be67578909888e76e81421d32459ace2a59b9d1d +Bug [#2135]. Prevent movement of candidate window while typing.
-diff --git a/scintilla/gtk/ScintillaGTK.cxx b/scintilla/gtk/ScintillaGTK.cxx ---- a/scintilla/gtk/ScintillaGTK.cxx -+++ b/scintilla/gtk/ScintillaGTK.cxx -@@ -2442,7 +2442,6 @@ +diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx +--- a/gtk/ScintillaGTK.cxx ++++ b/gtk/ScintillaGTK.cxx +@@ -2388,8 +2388,11 @@ + return; + } + +- if (initialCompose) ++ if (initialCompose) { + ClearBeforeTentativeStart(); ++ } ++ ++ SetCandidateWindowPos(); + pdoc->TentativeStart(); // TentativeActive() from now on + + std::vector<int> indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str); +@@ -2423,7 +2426,6 @@ }
EnsureCaretVisible(); - SetCandidateWindowPos(); ShowCaretAtCurrentPosition(); } catch (...) { errorStatus = SC_STATUS_FAILURE; -@@ -2487,6 +2486,7 @@ - } else { - sciThis->PreeditChangedWindowedThis(); - } -+ sciThis->SetCandidateWindowPos(); - } - - void ScintillaGTK::StyleSetText(GtkWidget *widget, GtkStyle *, void *) {
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).