[ibus-hangul] Update to 1.3.0.20100329-1.
Daiki Ueno
ueno at fedoraproject.org
Tue Aug 3 07:23:01 UTC 2010
commit ee858c370bb8494e25c8a06eea446b446094403c
Author: Daiki Ueno <ueno at unixuser.org>
Date: Tue Aug 3 16:23:10 2010 +0900
Update to 1.3.0.20100329-1.
.gitignore | 1 +
ibus-hangul-1.1.0.20090328-hanja-arrow-keys.patch | 27 -
ibus-hangul-1.1.0.20090328-right-ctrl-hanja.patch | 12 -
ibus-hangul-HEAD.patch | 154 ++++
ibus-hangul-phuang.patch | 939 ---------------------
ibus-hangul.spec | 14 +-
sources | 2 +-
7 files changed, 163 insertions(+), 986 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3bdd673..459b45c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
ibus-hangul-1.2.0.20100102.tar.gz
+ibus-hangul-1.3.0.20100329.tar.gz
diff --git a/ibus-hangul-HEAD.patch b/ibus-hangul-HEAD.patch
new file mode 100644
index 0000000..eabd621
--- /dev/null
+++ b/ibus-hangul-HEAD.patch
@@ -0,0 +1,154 @@
+diff --git a/src/engine.c b/src/engine.c
+index 2fffad0..95a4a62 100644
+--- a/src/engine.c
++++ b/src/engine.c
+@@ -89,6 +89,12 @@ static void ibus_hangul_engine_property_hide
+ const gchar *prop_name);
+ #endif
+
++static void ibus_hangul_engine_candidate_clicked
++ (IBusEngine *engine,
++ guint index,
++ guint button,
++ guint state);
++
+ static void ibus_hangul_engine_flush (IBusHangulEngine *hangul);
+ static void ibus_hangul_engine_update_preedit_text
+ (IBusHangulEngine *hangul);
+@@ -234,6 +240,8 @@ ibus_hangul_engine_class_init (IBusHangulEngineClass *klass)
+ engine_class->cursor_down = ibus_hangul_engine_cursor_down;
+
+ engine_class->property_activate = ibus_hangul_engine_property_activate;
++
++ engine_class->candidate_clicked = ibus_hangul_engine_candidate_clicked;
+ }
+
+ static void
+@@ -342,6 +350,11 @@ ibus_hangul_engine_update_preedit_text (IBusHangulEngine *hangul)
+ ustring_append_ucs4 (preedit, hic_preedit, -1);
+
+ if (ustring_length(preedit) > 0) {
++ IBusPreeditFocusMode preedit_option = IBUS_ENGINE_PREEDIT_COMMIT;
++
++ if (hangul->hanja_list != NULL)
++ preedit_option = IBUS_ENGINE_PREEDIT_CLEAR;
++
+ text = ibus_text_new_from_ucs4 ((gunichar*)preedit->data);
+ // ibus-hangul's internal preedit string
+ ibus_text_append_attribute (text, IBUS_ATTR_TYPE_UNDERLINE,
+@@ -356,7 +369,7 @@ ibus_hangul_engine_update_preedit_text (IBusHangulEngine *hangul)
+ text,
+ ibus_text_get_length (text),
+ TRUE,
+- IBUS_ENGINE_PREEDIT_COMMIT);
++ preedit_option);
+ } else {
+ text = ibus_text_new_from_static_string ("");
+ ibus_engine_update_preedit_text ((IBusEngine *)hangul, text, 0, FALSE);
+@@ -492,6 +505,9 @@ ibus_hangul_engine_update_lookup_table (IBusHangulEngine *hangul)
+ ibus_hangul_engine_update_hanja_list (hangul);
+
+ if (hangul->hanja_list != NULL) {
++ // We should redraw preedit text with IBUS_ENGINE_PREEDIT_CLEAR option
++ // here to prevent committing it on focus out event incidentally.
++ ibus_hangul_engine_update_preedit_text (hangul);
+ ibus_hangul_engine_apply_hanja_list (hangul);
+ } else {
+ ibus_hangul_engine_hide_lookup_table (hangul);
+@@ -505,6 +521,12 @@ ibus_hangul_engine_process_candidate_key_event (IBusHangulEngine *hangul,
+ {
+ if (keyval == IBUS_Escape) {
+ ibus_hangul_engine_hide_lookup_table (hangul);
++ // When the lookup table is poped up, preedit string is
++ // updated with IBUS_ENGINE_PREEDIT_CLEAR option.
++ // So, when focus is out, the preedit text will not be committed.
++ // To prevent this problem, we have to update preedit text here
++ // with IBUS_ENGINE_PREEDIT_COMMIT option.
++ ibus_hangul_engine_update_preedit_text (hangul);
+ return TRUE;
+ } else if (keyval == IBUS_Return) {
+ ibus_hangul_engine_commit_current_candidate (hangul);
+@@ -740,17 +762,16 @@ ibus_hangul_engine_flush (IBusHangulEngine *hangul)
+
+ ustring_append_ucs4 (hangul->preedit, str, -1);
+
+- if (ustring_length (hangul->preedit) == 0)
+- return;
++ if (ustring_length (hangul->preedit) != 0) {
++ str = ustring_begin (hangul->preedit);
++ text = ibus_text_new_from_ucs4 (str);
+
+- str = ustring_begin (hangul->preedit);
+- text = ibus_text_new_from_ucs4 (str);
++ ibus_engine_commit_text ((IBusEngine *) hangul, text);
+
+- ibus_engine_hide_preedit_text ((IBusEngine *) hangul);
+- // Use ibus_engine_update_preedit_text_with_mode instead.
+- //ibus_engine_commit_text ((IBusEngine *) hangul, text);
++ ustring_clear(hangul->preedit);
++ }
+
+- ustring_clear(hangul->preedit);
++ ibus_hangul_engine_update_preedit_text (hangul);
+ }
+
+ static void
+@@ -766,6 +787,8 @@ ibus_hangul_engine_focus_in (IBusEngine *engine)
+
+ ibus_engine_register_properties (engine, hangul->prop_list);
+
++ ibus_hangul_engine_update_preedit_text (hangul);
++
+ if (hangul->hanja_list != NULL) {
+ ibus_hangul_engine_update_lookup_table_ui (hangul);
+ }
+@@ -779,7 +802,11 @@ ibus_hangul_engine_focus_out (IBusEngine *engine)
+ IBusHangulEngine *hangul = (IBusHangulEngine *) engine;
+
+ if (hangul->hanja_list == NULL) {
+- ibus_hangul_engine_flush (hangul);
++ // ibus-hangul uses
++ // ibus_engine_update_preedit_text_with_mode() function which makes
++ // the preedit string committed automatically when the focus is out.
++ // So we don't need to commit the preedit here.
++ hangul_ic_reset (hangul->context);
+ } else {
+ ibus_engine_hide_lookup_table (engine);
+ ibus_engine_hide_auxiliary_text (engine);
+@@ -794,9 +821,6 @@ ibus_hangul_engine_reset (IBusEngine *engine)
+ IBusHangulEngine *hangul = (IBusHangulEngine *) engine;
+
+ ibus_hangul_engine_flush (hangul);
+- if (hangul->hanja_list != NULL) {
+- ibus_hangul_engine_hide_lookup_table (hangul);
+- }
+ parent_class->reset (engine);
+ }
+
+@@ -972,3 +996,26 @@ key_event_list_match(GArray* list, guint keyval, guint modifiers)
+
+ return FALSE;
+ }
++
++static void
++ibus_hangul_engine_candidate_clicked (IBusEngine *engine,
++ guint index,
++ guint button,
++ guint state)
++{
++ IBusHangulEngine *hangul = (IBusHangulEngine *) engine;
++ if (hangul == NULL)
++ return;
++
++ if (hangul->table == NULL)
++ return;
++
++ ibus_lookup_table_set_cursor_pos (hangul->table, index);
++ ibus_hangul_engine_commit_current_candidate (hangul);
++
++ if (hangul->hanja_mode) {
++ ibus_hangul_engine_update_lookup_table (hangul);
++ } else {
++ ibus_hangul_engine_hide_lookup_table (hangul);
++ }
++}
diff --git a/ibus-hangul.spec b/ibus-hangul.spec
index d7fdd48..df9189c 100644
--- a/ibus-hangul.spec
+++ b/ibus-hangul.spec
@@ -2,16 +2,14 @@
%define require_libhangul_version 0.0.10
Name: ibus-hangul
-Version: 1.2.0.20100102
+Version: 1.3.0.20100329
Release: 1%{?dist}
Summary: The Hangul engine for IBus input platform
License: GPLv2+
Group: System Environment/Libraries
URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
-# Patch0: ibus-hangul-1.1.0.20090328-right-ctrl-hanja.patch
-# Patch1: ibus-hangul-1.1.0.20090328-hanja-arrow-keys.patch
-Patch2: ibus-hangul-phuang.patch
+Patch0: ibus-hangul-HEAD.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -31,9 +29,7 @@ libhangul.
%prep
%setup -q
-# %patch0 -p1
-# %patch1 -p1
-%patch2 -p1
+%patch0 -p1
%build
%configure --disable-static
@@ -58,6 +54,10 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/ibus/component/*
%changelog
+* Tue Aug 3 2010 Daiki Ueno <dueno at redhat.com> - 1.3.0.20100329-1
+- Update version to 1.3.0.20100329
+- Add ibus-hangul-HEAD.patch to synch it with the git master
+
* Thu Feb 04 2010 Peng Huang <shawn.p.huang at gmail.com> - 1.2.0.20100102-1
- Update version to 1.2.0.20100102
- Add ibus-hangul-phuang.patch for ibus-1.2.99
diff --git a/sources b/sources
index 309b1fc..db9731b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-604d3cda1dbdf0b6c7a30d768a72f1ed ibus-hangul-1.2.0.20100102.tar.gz
+3464c98626685c8e23f6b0b580de2d08 ibus-hangul-1.3.0.20100329.tar.gz
More information about the scm-commits
mailing list