From 40022f97a721a0a93b903ba3649dc9c86bf05de5 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Oct 01 2010 09:33:04 +0000 Subject: Update to 1.3.1-3. --- diff --git a/ibus-m17n-shift-altgr.patch b/ibus-m17n-shift-altgr.patch new file mode 100644 index 0000000..fd162e0 --- /dev/null +++ b/ibus-m17n-shift-altgr.patch @@ -0,0 +1,67 @@ +From 8b6dc1102e7bad1016e1e504f22e9c9d65eb36bb Mon Sep 17 00:00:00 2001 +From: Daiki Ueno +Date: Wed, 29 Sep 2010 18:14:50 +0900 +Subject: [PATCH] Treat AltGr+Shift different from AltGr. + +According to Indic users, there should be 4 shift levels of keyboard symbols: +(1) no modifier keys are hold +(2) Shift key is pressed +(3) AltGr key is pressed +(4) both Shift and AltGr keys are pressed +Previously ibus-m17n only recognizes 1-3. This patch enables the 4th case. +--- + src/engine.c | 21 ++++++++++++++------- + 1 files changed, 14 insertions(+), 7 deletions(-) + +diff --git a/src/engine.c b/src/engine.c +index dbd00fc..e8e017b 100644 +--- a/src/engine.c ++++ b/src/engine.c +@@ -424,9 +424,9 @@ ibus_m17n_engine_commit_string (IBusM17NEngine *m17n, + ibus_m17n_engine_update_preedit (m17n); + } + +-/* Note on AltGr handling: While currently we expect AltGr == mod5, it +- would be better to not expect the modifier always be assigned +- to particular modX. However, it needs some code like: ++/* Note on AltGr (Level3 Shift) handling: While currently we expect ++ AltGr == mod5, it would be better to not expect the modifier always ++ be assigned to particular modX. However, it needs some code like: + + KeyCode altgr = XKeysymToKeycode (display, XK_ISO_Level3_Shift); + XModifierKeymap *mods = XGetModifierMapping (display); +@@ -448,20 +448,27 @@ ibus_m17n_key_event_to_symbol (guint keycode, + MSymbol mkeysym = Mnil; + guint mask = 0; + IBusKeymap *keymap; +- guint base_keyval; + + if (keyval >= IBUS_Shift_L && keyval <= IBUS_Hyper_R) { + return Mnil; + } + ++ /* Here KEYVAL is already translated by AltGr/Shift modifiers. ++ Get the keyval in one level lower to handle AltGr/Shift ++ modifiers correctly. */ + keymap = ibus_keymap_get ("us"); +- base_keyval = ibus_keymap_lookup_keysym (keymap, keycode, 0); ++ keyval = ibus_keymap_lookup_keysym (keymap, keycode, ++ (modifiers & IBUS_MOD5_MASK) ? ++ (modifiers & ~IBUS_MOD5_MASK) : ++ (modifiers & IBUS_SHIFT_MASK) ? ++ (modifiers & ~IBUS_SHIFT_MASK) : ++ modifiers); + g_object_unref (keymap); + + keysym = g_string_new (""); + +- if (base_keyval >= IBUS_space && base_keyval <= IBUS_asciitilde) { +- gint c = (modifiers & IBUS_MOD5_MASK) ? base_keyval : keyval; ++ if (keyval >= IBUS_space && keyval <= IBUS_asciitilde) { ++ gint c = keyval; + + if (keyval == IBUS_space && modifiers & IBUS_SHIFT_MASK) + mask |= IBUS_SHIFT_MASK; +-- +1.7.2.3 + diff --git a/ibus-m17n-surrounding-text.patch b/ibus-m17n-surrounding-text.patch index e9d8f63..b1ed3fb 100644 --- a/ibus-m17n-surrounding-text.patch +++ b/ibus-m17n-surrounding-text.patch @@ -1,17 +1,17 @@ -From d99ee4e1045346ab881525eb681abcf387d9b4cc Mon Sep 17 00:00:00 2001 +From 6bec9368e23e2637e81b7b6b56b02a88d5f2bbda Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 15 Sep 2010 12:21:35 +0900 Subject: [PATCH] Support surrounding-text commands. --- - src/engine.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++--- - 1 files changed, 47 insertions(+), 3 deletions(-) + src/engine.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/engine.c b/src/engine.c -index 260a806..f81b9ec 100644 +index 260a806..73d6ef2 100644 --- a/src/engine.c +++ b/src/engine.c -@@ -812,8 +812,52 @@ ibus_m17n_engine_callback (MInputContext *context, +@@ -812,8 +812,53 @@ ibus_m17n_engine_callback (MInputContext *context, } else if (command == Minput_reset) { } @@ -31,9 +31,10 @@ index 260a806..f81b9ec 100644 + &cursor_pos); + nchars = ibus_text_get_length (text); + nbytes = g_utf8_offset_to_pointer (text->text, nchars) - text->text; ++ mt = mconv_decode_buffer (Mcoding_utf_8, text->text, nbytes); ++ g_object_unref (text); + + len = (long) mplist_value (m17n->context->plist); -+ mt = mconv_decode_buffer (Mcoding_utf_8, text->text, nbytes); + if (len < 0) { + pos = cursor_pos + len; + if (pos < 0) @@ -68,5 +69,5 @@ index 260a806..f81b9ec 100644 } } -- -1.7.2.2 +1.7.2.3 diff --git a/ibus-m17n.spec b/ibus-m17n.spec index b79b958..2c82261 100644 --- a/ibus-m17n.spec +++ b/ibus-m17n.spec @@ -2,7 +2,7 @@ Name: ibus-m17n Version: 1.3.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The M17N engine for IBus platform License: GPLv2+ Group: System Environment/Libraries @@ -11,6 +11,7 @@ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz Patch0: ibus-m17n-iok.patch Patch1: ibus-m17n-surrounding-text.patch +Patch2: ibus-m17n-shift-altgr.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gettext-devel @@ -32,6 +33,7 @@ the input table maps from m17n-db. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %configure --disable-static @@ -56,6 +58,12 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/ibus/component/* %changelog +* Fri Oct 1 2010 Daiki Ueno - 1.3.1-3 +- Apply a patch to handle Shift+AltGr. +- Update surrounding-text patch. +- Fix bug 634829 - [abrt] ibus-m17n-1.3.1-1.fc14: shift_state: Process + /usr/libexec/ibus-engine-m17n was killed by signal 11 (SIGSEGV). + * Thu Sep 16 2010 Daiki Ueno - 1.3.1-2 - Apply surrounding text patch. Bug 435880.