Enhanced ibus-gnome3 shell lookup window.

Updated ibus-HEAD.patch from upstream
 * Fixed Bug 769135 - ibus-x11 SEGV in _process_key_event_done.
Updated ibus-541492-xkb.patch
 * Fixed Bug 757889 - ibus-setup SEGV without active engine.
 * Fixed Bug 760213 - ibus-setup saves XKB variants correctly.
 * Fixed Bug 769133 - ibus-engine-xkb returns FALSE for ASCII typings.
Updated ibus-xx-bridge-hotkey.patch for an enhancement.
This commit is contained in:
Takao Fujiwara 2011-12-30 17:16:36 +09:00
parent 969424670e
commit 8ffe46251d
7 changed files with 1094 additions and 45 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ ibus-1.3.6.tar.gz
/ibus-gjs-3.0.2.20111118.tar.gz
/ibus-gjs-3.2.1.20111118.tar.gz
/ibus-gjs-3.2.1.20111128.tar.gz
/ibus-gjs-3.2.1.20111230.tar.gz

View File

@ -1,6 +1,6 @@
From a7e922f290c1e3eba42ca1c6147ab1704ec272fb Mon Sep 17 00:00:00 2001
From 8f5bb828744532bcfded7e92f3a1db1f26e567e8 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Mon, 26 Sep 2011 13:06:05 +0900
Date: Fri, 30 Dec 2011 15:46:56 +0900
Subject: [PATCH] Reload preload engines until users customize the list.
The idea is, if users don't customize the preload_engines with ibus-setup,
@ -26,7 +26,7 @@ IBUS_PRELOAD_ENGINE_MODE_USER and users can customize the value
6 files changed, 440 insertions(+), 97 deletions(-)
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
index 1942504..3fce912 100644
index 059d660..bba9353 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
@@ -142,6 +142,9 @@ static void bus_ibus_impl_set_previous_engine
@ -503,7 +503,7 @@ index 1942504..3fce912 100644
{ "general", "use_global_engine", bus_ibus_impl_set_use_global_engine },
{ "general", "embed_preedit_text", bus_ibus_impl_set_embed_preedit_text },
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
index 8979515..fef1810 100644
index e0a6a37..2418c95 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
@@ -6,7 +6,7 @@
@ -560,10 +560,10 @@ index 6483aae..127ed93 100644
pass
diff --git a/setup/main.py b/setup/main.py
index 7f4a040..095084b 100644
index 97e05a4..7d734ae 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -91,6 +91,7 @@ class Setup(object):
@@ -92,6 +92,7 @@ class Setup(object):
# keyboard shortcut
# trigger
self.__config = self.__bus.get_config()
@ -571,7 +571,7 @@ index 7f4a040..095084b 100644
shortcuts = self.__config.get_value(
"general/hotkey", "trigger",
ibus.CONFIG_GENERAL_SHORTCUT_TRIGGER_DEFAULT)
@@ -212,15 +213,22 @@ class Setup(object):
@@ -213,15 +214,22 @@ class Setup(object):
self.__checkbutton_use_global_engine.connect("toggled", self.__checkbutton_use_global_engine_toggled_cb)
# init engine page
@ -599,7 +599,7 @@ index 7f4a040..095084b 100644
self.__treeview = self.__builder.get_object("treeview_engines")
self.__treeview.set_engines(engines)
@@ -248,7 +256,8 @@ class Setup(object):
@@ -251,7 +259,8 @@ class Setup(object):
def __combobox_notify_active_engine_cb(self, combobox, property):
engine = self.__combobox.get_active_engine()
button = self.__builder.get_object("button_engine_add")
@ -609,7 +609,7 @@ index 7f4a040..095084b 100644
def __get_engine_setup_exec_args(self, engine):
args = []
@@ -290,6 +299,26 @@ class Setup(object):
@@ -293,6 +302,26 @@ class Setup(object):
engine_names = map(lambda e: e.name, engines)
self.__config.set_list("general", "preload_engines", engine_names, "s")
@ -636,7 +636,7 @@ index 7f4a040..095084b 100644
def __button_engine_add_cb(self, button):
engine = self.__combobox.get_active_engine()
self.__treeview.append_engine(engine)
@@ -319,6 +348,32 @@ class Setup(object):
@@ -322,6 +351,32 @@ class Setup(object):
del self.__engine_setup_exec_list[name]
self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args)
@ -669,7 +669,7 @@ index 7f4a040..095084b 100644
def __init_bus(self):
try:
self.__bus = ibus.Bus()
@@ -509,7 +564,11 @@ class Setup(object):
@@ -512,7 +567,11 @@ class Setup(object):
self.__config.set_value("general", "use_global_engine", value)
def __config_value_changed_cb(self, bus, section, name, value):
@ -683,10 +683,10 @@ index 7f4a040..095084b 100644
def __config_reloaded_cb(self, bus):
pass
diff --git a/setup/setup.ui b/setup/setup.ui
index f1e6d0b..562c091 100644
index 57cb597..b2ceef2 100644
--- a/setup/setup.ui
+++ b/setup/setup.ui
@@ -585,7 +585,22 @@
@@ -582,7 +582,22 @@
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
@ -710,7 +710,7 @@ index f1e6d0b..562c091 100644
<property name="visible">True</property>
<child>
<object class="GtkAlignment" id="alignment6">
@@ -752,7 +767,7 @@
@@ -749,7 +764,7 @@
</child>
</object>
<packing>
@ -719,7 +719,7 @@ index f1e6d0b..562c091 100644
</packing>
</child>
<child>
@@ -791,7 +806,7 @@ You may use up/down buttons to change it
@@ -788,7 +803,7 @@ You may use up/down buttons to change it.&lt;/i&gt;&lt;/small&gt;</property>
</object>
<packing>
<property name="expand">False</property>
@ -750,5 +750,5 @@ index d916265..422eb84 100644
* @x: x coordinate.
* @y: y coordinate.
--
1.7.6.2
1.7.7.4

View File

@ -1,6 +1,6 @@
From a8f02d4be33f87cf97039736407cd13e795b992b Mon Sep 17 00:00:00 2001
From 5b4c1700b4798f20b61dec5193b3f08d1e60742d Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 18 Nov 2011 18:05:42 +0900
Date: Fri, 30 Dec 2011 15:46:13 +0900
Subject: [PATCH] Add XKB layouts
---
@ -18,7 +18,7 @@ Subject: [PATCH] Add XKB layouts
setup/enginecombobox.py | 7 +-
setup/main.py | 3 +
setup/setup.ui | 609 ++++++-
setup/xkbsetup.py | 457 +++++
setup/xkbsetup.py | 490 +++++
src/Makefile.am | 5 +
src/ibus.h | 1 +
src/ibusxkbxml.c | 441 +++++
@ -29,7 +29,7 @@ Subject: [PATCH] Add XKB layouts
xkb/gtkimcontextsimpleseqs.h | 4484 ++++++++++++++++++++++++++++++++++++++++++
xkb/ibus-engine-xkb-main.c | 303 +++
xkb/ibus-engine-xkb-main.h | 32 +
xkb/ibus-simple-engine.c | 1003 ++++++++++
xkb/ibus-simple-engine.c | 1007 ++++++++++
xkb/ibus-simple-engine.h | 13 +
xkb/ibus-xkb-main.c | 112 ++
xkb/xkblayout.xml.in | 16 +
@ -38,7 +38,7 @@ Subject: [PATCH] Add XKB layouts
xkb/xkblib.h | 41 +
xkb/xkbxml.c | 345 ++++
xkb/xkbxml.h | 113 ++
34 files changed, 9664 insertions(+), 4 deletions(-)
34 files changed, 9701 insertions(+), 4 deletions(-)
create mode 100644 ibus/xkblayout.py.in
create mode 100644 ibus/xkbxml.py.in
create mode 100644 setup/xkbsetup.py
@ -1153,7 +1153,7 @@ index 2fd8876..7383177 100644
+ self.__title = title
diff --git a/setup/main.py b/setup/main.py
index a22bb0c..7f4a040 100644
index 6c0fb0e..97e05a4 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -37,6 +37,7 @@ from gtk import gdk
@ -1164,7 +1164,7 @@ index a22bb0c..7f4a040 100644
from i18n import DOMAINNAME, _, N_, init as i18n_init
(
@@ -241,6 +242,8 @@ class Setup(object):
@@ -245,6 +246,8 @@ class Setup(object):
self.__combobox.connect("notify::active-engine", self.__combobox_notify_active_engine_cb)
self.__treeview.connect("notify", self.__treeview_notify_cb)
@ -1174,7 +1174,7 @@ index a22bb0c..7f4a040 100644
engine = self.__combobox.get_active_engine()
button = self.__builder.get_object("button_engine_add")
diff --git a/setup/setup.ui b/setup/setup.ui
index 0a69df8..f1e6d0b 100644
index c7ff564..57cb597 100644
--- a/setup/setup.ui
+++ b/setup/setup.ui
@@ -117,7 +117,6 @@
@ -1201,7 +1201,7 @@ index 0a69df8..f1e6d0b 100644
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
@@ -825,6 +822,7 @@ You may use up/down buttons to change it.&lt;/i&gt;&lt;/small&gt;</property>
@@ -841,6 +838,7 @@ You may use up/down buttons to change it.&lt;/i&gt;&lt;/small&gt;</property>
<property name="visible">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
@ -1209,7 +1209,7 @@ index 0a69df8..f1e6d0b 100644
<child>
<object class="GtkCheckButton" id="checkbutton_use_sys_layout">
<property name="label" translatable="yes">Use system keyboard layout</property>
@@ -840,6 +838,57 @@ You may use up/down buttons to change it.&lt;/i&gt;&lt;/small&gt;</property>
@@ -856,6 +854,57 @@ You may use up/down buttons to change it.&lt;/i&gt;&lt;/small&gt;</property>
<property name="position">0</property>
</packing>
</child>
@ -1267,7 +1267,7 @@ index 0a69df8..f1e6d0b 100644
</object>
</child>
</object>
@@ -1038,4 +1087,558 @@ Homepage: http://code.google.com/p/ibus
@@ -1054,4 +1103,558 @@ Homepage: http://code.google.com/p/ibus
</object>
</child>
</object>
@ -1828,10 +1828,10 @@ index 0a69df8..f1e6d0b 100644
</interface>
diff --git a/setup/xkbsetup.py b/setup/xkbsetup.py
new file mode 100644
index 0000000..af9ec53
index 0000000..e777cea
--- /dev/null
+++ b/setup/xkbsetup.py
@@ -0,0 +1,457 @@
@@ -0,0 +1,490 @@
+# vim:set et sts=4 sw=4:
+#
+# ibus - The Input Bus
@ -2061,7 +2061,15 @@ index 0000000..af9ec53
+ self.__treeview_system_keyboard_layout.set_engines([engine])
+ button_reset.set_sensitive(False)
+ else:
+ for layout in text.split(','):
+ # The saved string 'cz,us(qwerty,)' needs to be rearranged to
+ # ['cz(qwerty)', 'us'] for each engine.
+ [l, v] = self.__get_model_from_layout(text)
+ variants = []
+ if v != 'default' and v != None:
+ variants = v.split(',')
+ for i, layout in enumerate(l.split(',')):
+ if i < len(variants) and len(variants[i]) > 0:
+ layout = '%s(%s)' % (layout, variants[i])
+ layout_engine = None
+ for engine in xkb_engines:
+ if layout == engine.layout:
@ -2143,6 +2151,14 @@ index 0000000..af9ec53
+ self.__init_system_keyboard_layout()
+ self.__init_system_keyboard_option()
+
+ def __get_model_from_layout(self, layout):
+ left_bracket = layout.find('(')
+ right_bracket = layout.find(')')
+ if left_bracket >= 0 and right_bracket > left_bracket:
+ return (layout[:left_bracket] + layout[right_bracket + 1:], \
+ layout[left_bracket + 1:right_bracket])
+ return (layout, 'default')
+
+ def __combobox_notify_active_system_keyboard_layout_cb(self, combobox, property):
+ engine = self.__combobox_system_keyboard_layout.get_active_engine()
+ button = self.__builder.get_object("button_system_keyboard_layout_engine_add")
@ -2168,6 +2184,9 @@ index 0000000..af9ec53
+ def __button_system_keyboard_layout_add_cb(self, button):
+ engines = self.__treeview_system_keyboard_layout.get_engines()
+ engine = self.__combobox_system_keyboard_layout.get_active_engine()
+ if engine == None:
+ return
+ # If engines[0] is the default dummy engine:
+ if len(engines) > 0 and engines[0].layout == "default":
+ self.__treeview_system_keyboard_layout.set_engines([engine])
+ else:
@ -2226,12 +2245,26 @@ index 0000000..af9ec53
+
+ def __button_system_keyboard_layout_ok_cb(self, button):
+ self.__dialog_system_keyboard_layout.hide()
+ layout = "default"
+ layout = 'default'
+ variant = ''
+ has_variant = False
+ # if the string is 'cz(qwerty),us[options,...]', it would difficult
+ # to separate layouts by comma. So we rearrange this likes
+ # 'cz,us(qwerty,)[options,...]' here.
+ for engine in self.__treeview_system_keyboard_layout.get_engines():
+ [l, v] = self.__get_model_from_layout(engine.layout)
+ if v == 'default' or v == None:
+ v = ''
+ if len(v) > 0:
+ has_variant = True
+ if layout == "default":
+ layout = engine.layout
+ layout = l
+ variant = v
+ else:
+ layout = "%s,%s" % (layout, engine.layout)
+ layout = '%s,%s' % (layout, l)
+ variant = '%s,%s' % (variant, v)
+ if has_variant:
+ layout = '%s(%s)' % (layout, variant)
+ if layout == None or layout == "":
+ layout = "default"
+ org_layout = str(self.__config.get_value("general", "system_keyboard_layout", None))
@ -8097,10 +8130,10 @@ index 0000000..255e952
+#endif
diff --git a/xkb/ibus-simple-engine.c b/xkb/ibus-simple-engine.c
new file mode 100644
index 0000000..815311b
index 0000000..4b5bd83
--- /dev/null
+++ b/xkb/ibus-simple-engine.c
@@ -0,0 +1,1003 @@
@@ -0,0 +1,1007 @@
+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
+/* vim:set et sts=4: */
+#ifdef HAVE_CONFIG_H
@ -8891,7 +8924,11 @@ index 0000000..815311b
+ }
+
+ ch = ibus_keyval_to_unicode (keyval);
+ if (ch != 0 && !g_unichar_iscntrl (ch)) {
+ /* IBUS_CHANGE: RH#769133
+ * Since we use ibus xkb engines as the disable state,
+ * do not commit the characters locally without in_hex_sequence. */
+ if (ch != 0 && !g_unichar_iscntrl (ch) &&
+ simple->in_hex_sequence) {
+ ibus_simple_engine_commit_char (simple, ch);
+ return TRUE;
+ }
@ -10126,5 +10163,5 @@ index 0000000..6c00f1d
+G_END_DECLS
+#endif
--
1.7.6.4
1.7.7.4

File diff suppressed because it is too large Load Diff

View File

@ -1784,8 +1784,8 @@ index 8804634..549393a 100644
if value != 'default':
self.__xkblayout.set_default_layout(value)
+ if value.find('(') >= 0:
+ self.__default_layout = value.split('(')[0]
+ self.__default_model = value.split('(')[1].split(')')[0]
+ [self.__default_layout, self.__default_model] = \
+ self.__xkblayout.get_default_layout()
+ else:
+ self.__default_layout = value
+ self.__default_model = None

View File

@ -7,13 +7,13 @@
%if 0%{?fedora} > 16
%define have_bridge_hotkey 1
%define ibus_gjs_version 3.2.1.20111128
%define ibus_gjs_version 3.2.1.20111230
%define ibus_gjs_build_failure 1
%define have_dconf 1
%else
%if 0%{?fedora} > 15
%define have_bridge_hotkey 1
%define ibus_gjs_version 3.2.1.20111128
%define ibus_gjs_version 3.2.1.20111230
%define ibus_gjs_build_failure 0
%define have_dconf 1
%else
@ -33,7 +33,7 @@
Name: ibus
Version: 1.4.0
Release: 14%{?dist}
Release: 15%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
@ -435,6 +435,16 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
* Fri Dec 30 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.4.0-15
- Enhanced ibus-gnome3 shell lookup window.
- Updated ibus-HEAD.patch from upstream
Fixed Bug 769135 - ibus-x11 SEGV in _process_key_event_done.
- Updated ibus-541492-xkb.patch
Fixed Bug 757889 - ibus-setup SEGV without active engine.
Fixed Bug 760213 - ibus-setup saves XKB variants correctly.
Fixed Bug 769133 - ibus-engine-xkb returns FALSE for ASCII typings.
- Updated ibus-xx-bridge-hotkey.patch for an enhancement.
* Wed Nov 30 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.4.0-14
- Enabled dconf.
- Updated ibus-HEAD.patch

View File

@ -1,3 +1,3 @@
b4f063794e89c71eb1f8cb543210da30 ibus-1.4.0.tar.gz
4257048de65ea404389bb941a51db667 ibus-gjs-3.0.2.20111118.tar.gz
e79a4f384ff42491ee1e263482bd1bc6 ibus-gjs-3.2.1.20111128.tar.gz
2d2ad58e3e41429dbd883ba7e501c9b2 ibus-gjs-3.2.1.20111230.tar.gz