diff --git a/ibus-m17n-altgr.patch b/ibus-m17n-altgr.patch new file mode 100644 index 0000000..6af8203 --- /dev/null +++ b/ibus-m17n-altgr.patch @@ -0,0 +1,62 @@ +From b4f997685fd1df5e9d4e1f41e59e490e39d5b9d9 Mon Sep 17 00:00:00 2001 +From: Daiki Ueno +Date: Wed, 29 Sep 2010 18:14:50 +0900 +Subject: [PATCH] Simplify AltGr handling. + +--- + src/engine.c | 24 +++++++++++++++--------- + 1 files changed, 15 insertions(+), 9 deletions(-) + +diff --git a/src/engine.c b/src/engine.c +index dbd00fc..1dbcf34 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,26 @@ 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; + } + +- keymap = ibus_keymap_get ("us"); +- base_keyval = ibus_keymap_lookup_keysym (keymap, keycode, 0); +- g_object_unref (keymap); ++ /* Here, keyval is already translated by IBUS_MOD5_MASK. Obtain ++ the untranslated keyval from the underlying keymap and ++ represent the translated keyval as the form "G-", which m17n-lib accepts. */ ++ if (modifiers & IBUS_MOD5_MASK) { ++ keymap = ibus_keymap_get ("us"); ++ keyval = ibus_keymap_lookup_keysym (keymap, keycode, ++ modifiers & ~IBUS_MOD5_MASK); ++ 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 new file mode 100644 index 0000000..b1ed3fb --- /dev/null +++ b/ibus-m17n-surrounding-text.patch @@ -0,0 +1,73 @@ +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 | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- + 1 files changed, 48 insertions(+), 3 deletions(-) + +diff --git a/src/engine.c b/src/engine.c +index 260a806..73d6ef2 100644 +--- a/src/engine.c ++++ b/src/engine.c +@@ -812,8 +812,53 @@ ibus_m17n_engine_callback (MInputContext *context, + } + else if (command == Minput_reset) { + } +- else if (command == Minput_get_surrounding_text) { +- } +- else if (command == Minput_delete_surrounding_text) { ++ else if (command == Minput_get_surrounding_text && ++ (((IBusEngine *) m17n)->client_capabilities & ++ IBUS_CAP_SURROUNDING_TEXT) != 0) { ++ IBusText *text; ++ guint cursor_pos, nchars, nbytes; ++ MText *mt, *surround; ++ int len, pos; ++ ++ ibus_engine_get_surrounding_text ((IBusEngine *) m17n, ++ &text, ++ &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); ++ if (len < 0) { ++ pos = cursor_pos + len; ++ if (pos < 0) ++ pos = 0; ++ surround = mtext_duplicate (mt, pos, cursor_pos); ++ } ++ else if (len > 0) { ++ pos = cursor_pos + len; ++ if (pos > nchars) ++ pos = nchars; ++ surround = mtext_duplicate (mt, cursor_pos, pos); ++ } ++ else { ++ surround = mtext (); ++ } ++ m17n_object_unref (mt); ++ mplist_set (m17n->context->plist, Mtext, surround); ++ m17n_object_unref (surround); ++ } ++ else if (command == Minput_delete_surrounding_text && ++ (((IBusEngine *) m17n)->client_capabilities & ++ IBUS_CAP_SURROUNDING_TEXT) != 0) { ++ int len; ++ ++ len = (long) mplist_value (m17n->context->plist); ++ if (len < 0) ++ ibus_engine_delete_surrounding_text ((IBusEngine *) m17n, ++ len, -len); ++ else if (len > 0) ++ ibus_engine_delete_surrounding_text ((IBusEngine *) m17n, ++ 0, len); + } + } +-- +1.7.2.3 + diff --git a/ibus-m17n.spec b/ibus-m17n.spec index 8504f1f..622cb42 100644 --- a/ibus-m17n.spec +++ b/ibus-m17n.spec @@ -1,8 +1,8 @@ -%define require_ibus_version 1.3.7 +%define require_ibus_version 1.3.0 Name: ibus-m17n Version: 1.3.1 -Release: 1%{?dist} +Release: 4%{?dist} Summary: The M17N engine for IBus platform License: GPLv2+ Group: System Environment/Libraries @@ -10,6 +10,8 @@ URL: http://code.google.com/p/ibus/ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz Patch0: ibus-m17n-iok.patch +Patch1: ibus-m17n-surrounding-text.patch +Patch2: ibus-m17n-altgr.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gettext-devel @@ -30,6 +32,8 @@ the input table maps from m17n-db. %prep %setup -q %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %configure --disable-static @@ -54,6 +58,19 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/ibus/component/* %changelog +* Tue Oct 5 2010 Daiki Ueno - 1.3.1-4 +- Remove Shift+AltGr patch; apply a simplified AltGr patch. +- Fix bug 639963 - SHIFT switch is not working in layouts as expected. + +* 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. + * Fri Sep 3 2010 Daiki Ueno - 1.3.1-1 - Update to 1.3.1. - Fix bug 615158 - Do not change the background colour of the pre-edit buffer