From 0fff2dd6f37e6898fa1b514ebc970b6a81e3956f Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Oct 05 2010 03:32:14 +0000 Subject: Update to 1.3.1-4. --- 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-shift-altgr.patch b/ibus-m17n-shift-altgr.patch deleted file mode 100644 index fd162e0..0000000 --- a/ibus-m17n-shift-altgr.patch +++ /dev/null @@ -1,67 +0,0 @@ -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.spec b/ibus-m17n.spec index 2c82261..622cb42 100644 --- a/ibus-m17n.spec +++ b/ibus-m17n.spec @@ -2,7 +2,7 @@ Name: ibus-m17n Version: 1.3.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: The M17N engine for IBus platform License: GPLv2+ Group: System Environment/Libraries @@ -11,7 +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 +Patch2: ibus-m17n-altgr.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: gettext-devel @@ -58,6 +58,10 @@ 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.