Fixed Bug 696481 - no the variant maps without language codes

- Updated to 1.3.99.20110408
- Added ibus-xx-setup-frequent-lang.patch
- Updated ibus-541492-xkb.patch
- Added dependency of imsettings-gnome.
  Fixed Bug 696510 - need a dependency in ibus-gtk3 for imsettings-gnome
This commit is contained in:
Takao Fujiwara 2011-04-19 12:14:20 +09:00
parent 1a40464d6b
commit 48fb145b56
11 changed files with 506 additions and 3024 deletions

5
.gitignore vendored
View File

@ -8,8 +8,7 @@ ibus-1.3.6.tar.gz
/ibus-1.3.99.20110117.tar.gz
/ibus-1.3.99.20110127.tar.gz
/ibus-1.3.99.20110206.tar.gz
/ibus-ui-gjs-plugins-20110214.tar.bz2
/ibus-1.3.99.20110228.tar.gz
/ibus-1.3.99.20110408.tar.gz
/gnome-shell-ibus-plugins-20110317.tar.bz2
/ibus-icons-20110325.tar.bz2
/ibus-po-20110404.tar.bz2
/ibus_master_da.po

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
index 8d4ec36..0caa8c7 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
@@ -144,6 +144,9 @@ static void bus_ibus_impl_set_previous_engine
@@ -144,6 +144,9 @@ static void bus_ibus_impl_set_previo
static void bus_ibus_impl_set_preload_engines
(BusIBusImpl *ibus,
GVariant *value);
@ -40,7 +40,7 @@ index 8d4ec36..0caa8c7 100644
static void bus_ibus_impl_set_use_sys_layout
(BusIBusImpl *ibus,
GVariant *value);
@@ -278,6 +281,141 @@ _panel_destroy_cb (BusPanelProxy *panel,
@@ -284,6 +287,142 @@ _panel_destroy_cb (BusPanelProxy *panel,
g_object_unref (panel);
}
@ -127,6 +127,7 @@ index 8d4ec36..0caa8c7 100644
+ }
+ }
+
+ bus_ibus_impl_check_global_engine (ibus);
+ bus_ibus_impl_update_engines_hotkey_profile (ibus);
+}
+
@ -182,7 +183,7 @@ index 8d4ec36..0caa8c7 100644
static void
bus_ibus_impl_set_hotkey (BusIBusImpl *ibus,
GQuark hotkey,
@@ -388,34 +526,50 @@ static void
@@ -394,35 +533,50 @@ static void
bus_ibus_impl_set_preload_engines (BusIBusImpl *ibus,
GVariant *value)
{
@ -244,6 +245,7 @@ index 8d4ec36..0caa8c7 100644
+ preload_engine_mode = _get_config_preload_engine_mode (ibus);
}
- bus_ibus_impl_check_global_engine (ibus);
- bus_ibus_impl_update_engines_hotkey_profile (ibus);
+ if (preload_engine_mode == IBUS_PRELOAD_ENGINE_MODE_USER) {
+ return;
@ -254,7 +256,7 @@ index 8d4ec36..0caa8c7 100644
}
/**
@@ -496,89 +650,48 @@ bus_ibus_impl_set_use_global_engine (BusIBusImpl *ibus,
@@ -503,89 +657,48 @@ bus_ibus_impl_set_use_global_engine (Bus
}
}
@ -367,7 +369,7 @@ index 8d4ec36..0caa8c7 100644
#endif
}
@@ -594,6 +707,7 @@ const static struct {
@@ -601,6 +714,7 @@ const static struct {
{ "general/hotkey", "next_engine_in_menu", bus_ibus_impl_set_next_engine_in_menu },
{ "general/hotkey", "previous_engine", bus_ibus_impl_set_previous_engine },
{ "general", "preload_engines", bus_ibus_impl_set_preload_engines },
@ -403,18 +405,18 @@ diff --git a/ibus/common.py b/ibus/common.py
index e105f18..20c0710 100644
--- a/ibus/common.py
+++ b/ibus/common.py
@@ -33,6 +33,8 @@ __all__ = (
"ORIENTATION_HORIZONTAL",
"ORIENTATION_VERTICAL",
"ORIENTATION_SYSTEM",
@@ -40,6 +40,8 @@ __all__ = (
"BUS_REQUEST_NAME_REPLY_IN_QUEUE",
"BUS_REQUEST_NAME_REPLY_EXISTS",
"BUS_REQUEST_NAME_REPLY_ALREADY_OWNER",
+ "PRELOAD_ENGINE_MODE_USER",
+ "PRELOAD_ENGINE_MODE_LANG_RELATIVE",
"default_reply_handler",
"default_error_handler",
"DEFAULT_ASYNC_HANDLERS",
@@ -132,6 +134,10 @@ ORIENTATION_HORIZONTAL = 0
ORIENTATION_VERTICAL = 1
ORIENTATION_SYSTEM = 2
@@ -150,6 +152,10 @@ BUS_REQUEST_NAME_REPLY_IN_QUEUE = 2
BUS_REQUEST_NAME_REPLY_EXISTS = 3
BUS_REQUEST_NAME_REPLY_ALREADY_OWNER = 4
+# define preload engine mode
+PRELOAD_ENGINE_MODE_USER = 0
@ -539,8 +541,8 @@ diff --git a/src/ibustypes.h b/src/ibustypes.h
index 035d124..0a9d7b2 100644
--- a/src/ibustypes.h
+++ b/src/ibustypes.h
@@ -144,6 +144,16 @@ typedef enum {
} IBusOrientation;
@@ -177,6 +177,16 @@ typedef enum {
} IBusBusRequestNameReply;
/**
+ * IBusPreloadEngineMode:

View File

@ -1723,9 +1723,9 @@ index 0000000..0d57a1a
+ layout_lang = xkbconfig.get_layout_lang()
+ variant_desc = xkbconfig.get_variant_desc()
+ for layout in layout_list.keys():
+ if layout not in layout_lang:
+ continue
+ langs = layout_lang[layout]
+ langs = []
+ if layout in layout_lang:
+ langs = layout_lang[layout]
+ for lang in langs:
+ engine = ibus.XKBConfigRegistry.engine_desc_new(
+ lang,

File diff suppressed because it is too large Load Diff

View File

@ -1,87 +0,0 @@
From c6949a852235bedb44126c3c6f36e1fba4b71bce Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Tue, 8 Feb 2011 18:21:50 +0900
Subject: [PATCH] Added the optional sync mode apps in IBusIMContext.
---
client/gtk2/ibusimcontext.c | 27 +++++++++++++++++++++++++++
configure.ac | 11 +++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index bb5ae5c..a4e46cb 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -79,6 +79,7 @@ static const gchar *_no_snooper_apps = NO_SNOOPER_APPS;
static gboolean _use_key_snooper = ENABLE_SNOOPER;
static guint _key_snooper_id = 0;
+static const gchar *_sync_mode_apps = SYNC_MODE_APPS;
static gboolean _use_sync_mode = FALSE;
static GtkIMContext *_focus_im_context = NULL;
@@ -477,6 +478,32 @@ ibus_im_context_class_init (IBusIMContextClass *class)
g_strfreev (apps);
}
+ /* env IBUS_SYNC_MODE_APPS for sync mode apps */
+ /* It seems MetaDisplay does not take the events from gdk_event_put()
+ * in async mode. So if gnome-shell + mutter are used,
+ * the key events are lost in async mode.
+ * gnome-shell search box, actually st_im_text_key_press_event(),
+ * does not call the parent filter_keypress() when the IM client
+ * returns TRUE. The class inherits ClutterActor which is not
+ * GtkWidget so the clutter does not call GTK snoopers.
+ * So ibus_im_context_filter_keypress() needs to return FALSE. */
+ if (!_use_sync_mode) {
+ /* enable sync mode if app is in _sync_mode_apps */
+ const gchar * prgname = g_get_prgname ();
+ if (g_getenv ("IBUS_SYNC_MODE_APPS")) {
+ _sync_mode_apps = g_getenv ("IBUS_SYNC_MODE_APPS");
+ }
+ gchar **p;
+ gchar ** apps = g_strsplit (_sync_mode_apps, ",", 0);
+ for (p = apps; *p != NULL; p++) {
+ if (g_regex_match_simple (*p, prgname, 0, 0)) {
+ _use_sync_mode = TRUE;
+ break;
+ }
+ }
+ g_strfreev (apps);
+ }
+
/* init bus object */
if (_bus == NULL) {
ibus_set_display (gdk_display_get_name (gdk_display_get_default ()));
diff --git a/configure.ac b/configure.ac
index 1a1e663..81efe81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -354,6 +354,16 @@ AC_ARG_WITH(no-snooper-apps,
AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
[Does not enbale keyboard snooper in those applications])
+# option for sync mode applications.
+AC_ARG_WITH(sync-mode-apps,
+ AS_HELP_STRING([--with-sync-mode-apps[=regex1,regex2]],
+ [Enable sync mode in those applications (like: .*chrome.*,firefox.*)]),
+ [SYNC_MODE_APPS=$with_sync_mode_apps],
+ [SYNC_MODE_APPS=[mutter]]
+)
+AC_DEFINE_UNQUOTED(SYNC_MODE_APPS, "$SYNC_MODE_APPS",
+ [Enbale sync mode in those applications])
+
# check iso-codes
PKG_CHECK_MODULES(ISOCODES, [
iso-codes
@@ -423,6 +433,7 @@ Build options:
Build vala binding $enable_vala
Build document $enable_gtk_doc
Enable key snooper $enable_key_snooper
+ Sync mode regexes "$SYNC_MODE_APPS"
No snooper regexes "$NO_SNOOPER_APPS"
])
--
1.7.3.2

View File

@ -1,14 +0,0 @@
--- ibus/ui/gtk/main.py.bak 2011-03-23 13:15:53.150298531 +0900
+++ ibus/ui/gtk/main.py 2011-03-23 13:16:35.336275938 +0900
@@ -114,8 +114,9 @@ def main():
print_help(sys.stderr, 1)
if stop_by_shell and ibus.is_running_gnome_shell():
- print "Exit because GNOME-Shell is running"
- sys.exit()
+ if os.path.exists('/usr/share/gnome-shell/js/ui/status/ibus'):
+ print "Exit because GNOME-Shell is running"
+ sys.exit()
if daemonize:
if os.fork():

View File

@ -1,427 +1 @@
From fbdd157b2ab1e6e873818132530dd9e55e4f94dd Mon Sep 17 00:00:00 2001
From: Peng Huang <shawn.p.huang@gmail.com>
Date: Mon, 7 Mar 2011 10:26:04 -0500
Subject: [PATCH] Move gtk_key_snooper_remove from function object_fini to class_fini.
BUG=http://crosbug.com/12803
TEST=Linux desktop
Review URL: http://codereview.appspot.com/4267044
---
client/gtk2/ibusimcontext.c | 24 +++++++++++++++---------
1 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index a634d0e..31a415d 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -88,6 +88,7 @@ static GtkWidget *_input_widget = NULL;
/* functions prototype */
static void ibus_im_context_class_init (IBusIMContextClass *class);
+static void ibus_im_context_class_fini (IBusIMContextClass *class);
static void ibus_im_context_init (GObject *obj);
static void ibus_im_context_finalize (GObject *obj);
static void ibus_im_context_reset (GtkIMContext *context);
@@ -152,10 +153,10 @@ ibus_im_context_register_type (GTypeModule *type_module)
static const GTypeInfo ibus_im_context_info = {
sizeof (IBusIMContextClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
(GClassInitFunc) ibus_im_context_class_init,
- NULL, /* class finialize */
+ (GClassFinalizeFunc) ibus_im_context_class_fini,
NULL, /* class data */
sizeof (IBusIMContext),
0,
@@ -477,6 +478,16 @@ ibus_im_context_class_init (IBusIMContextClass *class)
_key_snooper_id = gtk_key_snooper_install (_key_snooper_cb, NULL);
}
+static void
+ibus_im_context_class_fini (IBusIMContextClass *class)
+{
+ if (_key_snooper_id != 0) {
+ IDEBUG ("snooper is terminated.");
+ gtk_key_snooper_remove (_key_snooper_id);
+ _key_snooper_id = 0;
+ }
+}
+
/* Copied from gtk+2.0-2.20.1/modules/input/imcedilla.c to fix crosbug.com/11421.
* Overwrite the original Gtk+'s compose table in gtk+-2.x.y/gtk/gtkimcontextsimple.c. */
@@ -601,12 +612,6 @@ ibus_im_context_finalize (GObject *obj)
pango_attr_list_unref (ibusimcontext->preedit_attrs);
}
- if (_key_snooper_id != 0) {
- IDEBUG ("snooper is terminated.");
- gtk_key_snooper_remove (_key_snooper_id);
- _key_snooper_id = 0;
- }
-
G_OBJECT_CLASS(parent_class)->finalize (obj);
}
--
1.7.4.1
From c0489ba017f298e51efe86bc7f5def1928389197 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 11 Mar 2011 15:53:53 +0900
Subject: [PATCH] Fix preedit_string = NULL in ibus-x11 _free_ic()
---
client/x11/main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/client/x11/main.c b/client/x11/main.c
index a2967cc..16104de 100644
--- a/client/x11/main.c
+++ b/client/x11/main.c
@@ -526,6 +526,7 @@ _free_ic (gpointer data, gpointer user_data)
g_return_if_fail (x11ic != NULL);
g_free (x11ic->preedit_string);
+ x11ic->preedit_string = NULL;
if (x11ic->preedit_attrs) {
g_object_unref (x11ic->preedit_attrs);
--
1.7.4.1
From b9b2c42596e1a7394e89c11025074aed2fcb099a Mon Sep 17 00:00:00 2001
From: Peng Huang <shawn.p.huang@gmail.com>
Date: Wed, 16 Mar 2011 10:02:47 -0400
Subject: [PATCH] Fix issue of InputContext.SetEngine.
InputContext.SetEngine returns error sometimes, because "request-engine"
signal handler calls an async function to set the engine of the context.
So checking context->engine != NULL just after emiting "request-engine"
signal is not correct.
BUG=none
TEST=Linux desktop
Review URL: http://codereview.appspot.com/4287049
---
bus/ibusimpl.c | 68 ++++++++++++++++++++++++-----------
bus/inputcontext.c | 97 +++++++++++++++++++++++++++++++++++++++++++--------
bus/marshalers.list | 14 ++++----
3 files changed, 136 insertions(+), 43 deletions(-)
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
index 8d4ec36..5a8e134 100644
--- a/bus/ibusimpl.c
+++ b/bus/ibusimpl.c
@@ -186,6 +186,9 @@ static BusInputContext
(BusIBusImpl *ibus,
BusConnection *connection,
const gchar *client);
+static IBusEngineDesc
+ *bus_ibus_impl_get_engine_desc (BusIBusImpl *ibus,
+ const gchar *engine_name);
/* some callback functions */
static void _context_engine_changed_cb (BusInputContext *context,
BusIBusImpl *ibus);
@@ -975,21 +978,30 @@ _find_engine_desc_by_name (BusIBusImpl *ibus,
*
* A callback function to be called when the "request-engine" signal is sent to the context.
*/
-static void
+static IBusEngineDesc *
_context_request_engine_cb (BusInputContext *context,
const gchar *engine_name,
BusIBusImpl *ibus)
{
- IBusEngineDesc *desc = NULL;
+ return bus_ibus_impl_get_engine_desc (ibus, engine_name);
+}
- /* context should has focus before request an engine */
- g_return_if_fail (bus_input_context_has_focus (context) ||
- context == ibus->focused_context);
+/**
+ * bus_ibus_impl_get_engine_desc:
+ *
+ * Get the IBusEngineDesc by engine_name. If the engine_name is NULL, return
+ * a default engine desc.
+ */
+static IBusEngineDesc *
+bus_ibus_impl_get_engine_desc (BusIBusImpl *ibus,
+ const gchar *engine_name)
+{
+ IBusEngineDesc *desc = NULL;
if (engine_name != NULL && engine_name[0] != '\0') {
/* request engine by name */
desc = _find_engine_desc_by_name (ibus, engine_name);
- g_return_if_fail (desc != NULL);
+ g_return_val_if_fail (desc != NULL, NULL);
}
else {
/* Use global engine if possible. */
@@ -1018,11 +1030,11 @@ _context_request_engine_cb (BusInputContext *context,
* not find any default engines. another possiblity is that the
* user hasn't installed an engine yet? just give up. */
g_warning ("No engine is available. Run ibus-setup first.");
- return;
+ return NULL;
}
}
- bus_ibus_impl_set_context_engine_from_desc (ibus, context, desc);
+ return desc;
}
/**
@@ -1041,7 +1053,11 @@ bus_ibus_impl_context_request_next_engine_in_menu (BusIBusImpl *ibus,
engine = bus_input_context_get_engine (context);
if (engine == NULL) {
- _context_request_engine_cb (context, NULL, ibus);
+ desc = bus_ibus_impl_get_engine_desc (ibus, NULL);
+ if (desc != NULL)
+ bus_ibus_impl_set_context_engine_from_desc (ibus,
+ context,
+ desc);
return;
}
@@ -1112,7 +1128,14 @@ bus_ibus_impl_context_request_previous_engine (BusIBusImpl *ibus,
bus_ibus_impl_context_request_next_engine_in_menu (ibus, context);
return;
}
- _context_request_engine_cb (context, engine_name, ibus);
+
+ IBusEngineDesc *desc = NULL;
+ desc = bus_ibus_impl_get_engine_desc (ibus, engine_name);
+ if (desc != NULL) {
+ bus_ibus_impl_set_context_engine_from_desc (ibus,
+ context,
+ desc);
+ }
}
static void
diff --git a/bus/inputcontext.c b/bus/inputcontext.c
index c226a20..6d65830 100644
--- a/bus/inputcontext.c
+++ b/bus/inputcontext.c
@@ -20,11 +20,13 @@
* Boston, MA 02111-1307, USA.
*/
#include "inputcontext.h"
-#include "types.h"
-#include "marshalers.h"
-#include "ibusimpl.h"
+
#include "engineproxy.h"
#include "factoryproxy.h"
+#include "ibusimpl.h"
+#include "marshalers.h"
+#include "option.h"
+#include "types.h"
struct _SetEngineByDescData {
/* context related to the data */
@@ -565,8 +567,8 @@ bus_input_context_class_init (BusInputContextClass *class)
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
- bus_marshal_VOID__STRING,
- G_TYPE_NONE,
+ bus_marshal_OBJECT__STRING,
+ IBUS_TYPE_ENGINE_DESC,
1,
G_TYPE_STRING);
@@ -917,6 +919,26 @@ _ic_is_enabled (BusInputContext *context,
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(b)", context->enabled));
}
+static void
+_ic_set_engine_done (BusInputContext *context,
+ GAsyncResult *res,
+ GDBusMethodInvocation *invocation)
+{
+ gboolean retval = FALSE;
+ GError *error = NULL;
+
+ retval = bus_input_context_set_engine_by_desc_finish (context,
+ res, &error);
+
+ if (!retval) {
+ g_dbus_method_invocation_return_gerror (invocation, error);
+ g_error_free (error);
+ }
+ else {
+ g_dbus_method_invocation_return_value (invocation, NULL);
+ }
+}
+
/**
* _ic_set_engine:
*
@@ -930,16 +952,34 @@ _ic_set_engine (BusInputContext *context,
gchar *engine_name = NULL;
g_variant_get (parameters, "(&s)", &engine_name);
- g_signal_emit (context, context_signals[REQUEST_ENGINE], 0, engine_name);
-
- if (context->engine == NULL) {
- g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
- "Can not find engine '%s'.", engine_name);
+ if (!bus_input_context_has_focus (context)) {
+ g_dbus_method_invocation_return_error (invocation,
+ G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+ "Context which does not has focus can not change engine to %s.",
+ engine_name);
+ return;
}
- else {
- bus_input_context_enable (context);
- g_dbus_method_invocation_return_value (invocation, NULL);
+
+ IBusEngineDesc *desc = NULL;
+ g_signal_emit (context,
+ context_signals[REQUEST_ENGINE], 0,
+ engine_name,
+ &desc);
+ if (desc == NULL) {
+ g_dbus_method_invocation_return_error (invocation,
+ G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+ "Can not find engine %s.", engine_name);
+ return;
}
+
+ bus_input_context_set_engine_by_desc (context,
+ desc,
+ g_gdbus_timeout,
+ NULL,
+ (GAsyncReadyCallback)_ic_set_engine_done,
+ invocation);
+
+ g_object_unref (desc);
}
/**
@@ -1045,7 +1085,21 @@ bus_input_context_focus_in (BusInputContext *context)
if (context->engine == NULL && context->enabled) {
/* request an engine, e.g. a global engine if the feature is enabled. */
- g_signal_emit (context, context_signals[REQUEST_ENGINE], 0, NULL);
+ IBusEngineDesc *desc = NULL;
+ g_signal_emit (context,
+ context_signals[REQUEST_ENGINE], 0,
+ NULL,
+ &desc);
+
+ if (desc != NULL) {
+ bus_input_context_set_engine_by_desc (context,
+ desc,
+ g_gdbus_timeout, /* timeout in msec. */
+ NULL, /* we do not cancel the call. */
+ NULL, /* use the default callback function. */
+ NULL);
+ g_object_unref (desc);
+ }
}
if (context->engine && context->enabled) {
@@ -1927,7 +1981,20 @@ bus_input_context_enable (BusInputContext *context)
}
if (context->engine == NULL) {
- g_signal_emit (context, context_signals[REQUEST_ENGINE], 0, NULL);
+ IBusEngineDesc *desc = NULL;
+ g_signal_emit (context,
+ context_signals[REQUEST_ENGINE], 0,
+ NULL,
+ &desc);
+ if (desc != NULL) {
+ bus_input_context_set_engine_by_desc (context,
+ desc,
+ g_gdbus_timeout, /* timeout in msec. */
+ NULL, /* we do not cancel the call. */
+ NULL, /* use the default callback function. */
+ NULL);
+ g_object_unref (desc);
+ }
}
if (context->engine == NULL)
diff --git a/bus/marshalers.list b/bus/marshalers.list
index 15bdf02..159bc24 100644
--- a/bus/marshalers.list
+++ b/bus/marshalers.list
@@ -1,13 +1,13 @@
-VOID:VOID
-VOID:STRING
-VOID:OBJECT
+BOOL:UINT,UINT,UINT
+OBJECT:STRING
VOID:INT,UINT
-VOID:UINT,UINT,UINT
VOID:INT,INT,INT,INT
-VOID:STRING,INT
VOID:OBJECT
-VOID:STRING,STRING,STRING
VOID:OBJECT,BOOLEAN
VOID:OBJECT,UINT,BOOLEAN
VOID:OBJECT,UINT,BOOLEAN,UINT
-BOOL:UINT,UINT,UINT
+VOID:STRING
+VOID:STRING,INT
+VOID:STRING,STRING,STRING
+VOID:UINT,UINT,UINT
+VOID:VOID
--
1.7.4.1
From a9a7d77b540826259889aa8c8936b7a3cae1593d Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 25 Mar 2011 13:57:31 +0900
Subject: [PATCH] Set WM_CLASS name instead of main.py
---
ui/gtk/panel.py | 11 ++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/ui/gtk/panel.py b/ui/gtk/panel.py
index 07b0fa2..9d63a17 100644
--- a/ui/gtk/panel.py
+++ b/ui/gtk/panel.py
@@ -37,7 +37,7 @@
from i18n import _, N_
-ICON_KEYBOARD = "ibus-keyboard"
+ICON_KEYBOARD = "input-keyboard-symbolic"
ICON_ENGINE = "ibus-engine"
def show_uri(screen, link):
@@ -103,6 +103,16 @@ class Panel(ibus.PanelBase):
self.__status_icon = gtk.StatusIcon()
+ # gnome-shell checks XClassHint.res_class with ShellTrayIcon.
+ # gtk_status_icon_set_name() can set XClassHint.res_class .
+ # However gtk_status_icon_new() also calls gtk_window_realize() so
+ # gtk_status_icon_set_visible() needs to be called to set WM_CLASS
+ # so that gtk_window_realize() is called later again.
+ # set_title is for gnome-shell notificationDaemon in bottom right.
+ self.__status_icon.set_visible(False)
+ self.__status_icon.set_name('ibus-ui-gtk')
+ self.__status_icon.set_title(_("IBus Panel"))
+ self.__status_icon.set_visible(True)
self.__status_icon.connect("popup-menu", self.__status_icon_popup_menu_cb)
self.__status_icon.connect("activate", self.__status_icon_activate_cb)
self.__status_icon.set_from_icon_name(ICON_KEYBOARD)
--
1.7.4.1

View File

@ -0,0 +1,428 @@
From 8e982ef7d76f40f3e516c2f2a96b2e4f68e65fc2 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Tue, 19 Apr 2011 11:43:03 +0900
Subject: [PATCH] Enable ibus-setup to show the frequent used languages only in IME list.
---
data/ibus.schemas.in | 168 +++++++++++++++++++++++++++++++++++++++++++++++
setup/enginecombobox.py | 153 ++++++++++++++++++++++++++++++++++++------
setup/main.py | 1 +
3 files changed, 300 insertions(+), 22 deletions(-)
diff --git a/data/ibus.schemas.in b/data/ibus.schemas.in
index 39922a0..2e33b2c 100644
--- a/data/ibus.schemas.in
+++ b/data/ibus.schemas.in
@@ -239,6 +239,174 @@
</locale>
</schema>
<schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/group_list</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/group_list</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <default>[west_europe,south_europe,east_europe,north_europe,west_asia,center_asia,east_asia,india,australia]</default>
+ <locale name="C">
+ <short>List of system keyboard layout groups on ibus-setup</short>
+ <long>The group list is used not to show all the system
+ keyboard layouts by default. The list item will be
+ appended at the end of gconf key. e.g.
+ .../xkblayoutconfig/system/item1</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/west_europe</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/west_europe</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[ad,be,br,de,ca,ch,cz,es,fr,gn,hu,ie,ie(CloGaelach),it,latam,nl,pt,si,sk]</default>
+ -->
+ <default>[ca,cs,de,en,es,fr,gd,hu,it,nl,pt,sk,sl]</default>
+ <locale name="C">
+ <short>List of European languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/south_europe</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/south_europe</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[al,ba,bg,gr,me,mk,mt,ro,rs]</default>
+ -->
+ <default>[bg,bs,el,mk,mt,ro,sq,sr]</default>
+ <locale name="C">
+ <short>List of European languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/east_europe</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/east_europe</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[by,ee,epo,ge,ge(dsb),ge(ru),ge(os),hr,kg,kz,lt,lv,pl,pl(csb),ru,ru(cv),ru(kom),ru(sah),ru(tt),ru(xal),ua,uz]</default>
+ -->
+ <default>[be,csb,cv,et,ka,kk,ky,lt,lv,pl,ru,tt,uk,uz]</default>
+ <locale name="C">
+ <short>List of European languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/north_europe</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/north_europe</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[dk,fi,fo,is,no,no(smi),se]</default>
+ -->
+ <default>[da,fi,fo,is,no,se,sv]</default>
+ <locale name="C">
+ <short>List of European languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/west_asia</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/west_asia</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[am,ara,az,et,gh,gh(akan),gh(ewe),gh(fula),gh(ga),gh(hausa),il,iq,iq(ku),ir,ir(ku),ma,ma(tifinagh),ng,ng(hausa),ng,ng(igbo),ng(yoruba),sy,sy(ku),tj,tr]</default>
+ -->
+ <default>[am,ar,az,ber,fa,ha,he,hy,ig,ku,tg,tr,yo]</default>
+ <locale name="C">
+ <short>List of Asian languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/center_asia</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/center_asia</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[cn(tib)]</default>
+ -->
+ <default>[bo,zh]</default>
+ <locale name="C">
+ <short>List of Asian languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/east_asia</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/east_asia</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[bt,kh,la,mal,mm,th,vn]</default>
+ -->
+ <default>[dz,km,lo,my,th,vi]</default>
+ <locale name="C">
+ <short>List of Asian languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/india</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/india</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[bd,in,in(ben),in(guj),in(guru),in(jhelum),in(kan),in(mal),in(ori),in(tam),in(tel),in(urd-phonetic),in(bolnagri),lk,lk(tam_unicode),mv,np,pk]</default>
+ -->
+ <default>[bn,dv,gu,hi,kn,ml,ne,or,pa,si,ta,te,ur]</default>
+ <locale name="C">
+ <short>List of Asian languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
+ <key>/schemas/desktop/ibus/general/xkblayoutconfig/system/australia</key>
+ <applyto>/desktop/ibus/general/xkblayoutconfig/system/australia</applyto>
+ <owner>ibus</owner>
+ <type>list</type>
+ <list_type>string</list_type>
+ <!--
+ <default>[mao]</default>
+ -->
+ <default>[mi]</default>
+ <locale name="C">
+ <short>List of Asian languages on ibus-setup</short>
+ <long>ibus-setup shows the languages only in input method list
+ when you run ibus-setup on one of the languages.
+ Other languages are hidden under an extended button.</long>
+ </locale>
+ </schema>
+ <schema>
<key>/schemas/desktop/ibus/panel/use_custom_font</key>
<applyto>/desktop/ibus/panel/use_custom_font</applyto>
<owner>ibus</owner>
diff --git a/setup/enginecombobox.py b/setup/enginecombobox.py
index 7383177..c5b194f 100644
--- a/setup/enginecombobox.py
+++ b/setup/enginecombobox.py
@@ -43,7 +43,10 @@ class EngineComboBox(gtk.ComboBox):
self.connect("notify::active", self.__notify_active_cb)
self.__model = None
+ self.__all_model = None
+ self.__config = None
self.__title = _("Select an input method")
+ self.__show_sub_lang = False
renderer = gtk.CellRendererPixbuf()
renderer.set_property("xalign", 0)
@@ -57,18 +60,51 @@ class EngineComboBox(gtk.ComboBox):
self.pack_start(renderer, True)
self.set_cell_data_func(renderer, self.__name_cell_data_cb)
- def set_engines(self, engines):
- self.__model = gtk.TreeStore(gobject.TYPE_PYOBJECT)
+ def __gconf_get_lang_list_from_locale(self):
+ common_list = ['en', 'Other']
+ if self.__config == None:
+ return None
+ loc = None
+ try:
+ loc = locale.setlocale (locale.LC_ALL)
+ except:
+ pass
+ if loc == None:
+ return common_list
+ current_lang = ibus.get_language_name(loc)
+ if current_lang == None:
+ return common_list
+ group_list = self.__config.get_value("general/xkblayoutconfig/system",
+ "group_list", None)
+ if group_list == None:
+ return [loc] + common_list
+ group_list = list(group_list)
+ lang_list = None
+ for group in group_list:
+ group = str(group)
+ langs = self.__config.get_value("general/xkblayoutconfig/system",
+ group, [])
+ for lang in langs:
+ lang = str(lang)
+ if current_lang == ibus.get_language_name(lang):
+ lang_list = langs
+ break
+ if lang_list != None:
+ break
+ if lang_list == None:
+ return [loc] + common_list
+ return lang_list + common_list
- iter1 = self.__model.append(None)
- self.__model.set(iter1, 0, 0)
- lang = {}
- for e in engines:
- l = ibus.get_language_name(e.language)
- if l not in lang:
- lang[l] = []
- lang[l].append(e)
+ def __has_engine_in_lang_list(self, engine, lang_list):
+ retval = False
+ for lang in lang_list:
+ if ibus.get_language_name(lang) == \
+ ibus.get_language_name(engine.language):
+ retval = True
+ break
+ return retval
+ def __model_append_langs(self, model, lang, visible):
keys = lang.keys()
keys.sort(locale.strcoll)
#add "Others" to the end of the combo box
@@ -76,29 +112,86 @@ class EngineComboBox(gtk.ComboBox):
keys.remove(ibus.get_language_name("Other"))
keys += [ibus.get_language_name("Other")]
for l in keys:
- iter1 = self.__model.append(None)
- self.__model.set(iter1, 0, l)
+ iter1 = model.append(None)
+ model.set(iter1, 0, l)
def cmp_engine(a, b):
if a.rank == b.rank:
return locale.strcoll(a.longname, b.longname)
return int(b.rank - a.rank)
lang[l].sort(cmp_engine)
for e in lang[l]:
- iter2 = self.__model.append(iter1)
- self.__model.set(iter2, 0, e)
+ iter2 = model.append(iter1)
+ model.set(iter2, 0, e)
+
+ def set_engines(self, engines):
+ self.__model = gtk.TreeStore(gobject.TYPE_PYOBJECT)
+
+ iter1 = self.__model.append(None)
+ self.__model.set(iter1, 0, 0)
+ lang_list = self.__gconf_get_lang_list_from_locale()
+ lang = {}
+ sub_lang = {}
+ for e in engines:
+ l = ibus.get_language_name(e.language)
+ if lang_list == None or \
+ self.__has_engine_in_lang_list(e, lang_list):
+ if l not in lang:
+ lang[l] = []
+ lang[l].append(e)
+ else:
+ if l not in sub_lang:
+ sub_lang[l] = []
+ sub_lang[l].append(e)
+
+ self.__model_append_langs(self.__model, lang, True)
+ iter1 = self.__model.append(None)
+ self.__model.set(iter1, 0, -1)
+
+ self.__all_model = gtk.TreeStore(gobject.TYPE_PYOBJECT)
+ iter1 = self.__all_model.append(None)
+ self.__all_model.set(iter1, 0, 0)
+ self.__model_append_langs(self.__all_model, lang, False)
+ iter1 = self.__all_model.append(None)
+ self.__all_model.set(iter1, 0, -1)
+ self.__model_append_langs(self.__all_model, sub_lang, False)
+
+ self.__toggle_sub_lang()
- self.set_model(self.__model)
+ def __toggle_sub_lang(self):
+ self.set_model(None)
+ if self.__show_sub_lang:
+ self.set_model(self.__all_model)
+ else:
+ self.set_model(self.__model)
self.set_active(0)
def __icon_cell_data_cb(self, celllayout, renderer, model, iter):
- engine = self.__model.get_value(iter, 0)
+ model = self.get_model()
+ engine = model.get_value(iter, 0)
if isinstance(engine, str) or isinstance (engine, unicode):
renderer.set_property("visible", False)
renderer.set_property("sensitive", False)
elif isinstance(engine, int):
- renderer.set_property("visible", False)
- renderer.set_property("sensitive", False)
+ if engine == 0:
+ renderer.set_property("visible", False)
+ renderer.set_property("sensitive", False)
+ renderer.set_property("pixbuf", None)
+ elif engine < 0:
+ if not self.__show_sub_lang:
+ pixbuf = load_icon("list-add", gtk.ICON_SIZE_LARGE_TOOLBAR)
+ else:
+ pixbuf = load_icon("list-remove", gtk.ICON_SIZE_LARGE_TOOLBAR)
+ if pixbuf == None:
+ pixbuf = load_icon("gtk-missing-image",
+ gtk.ICON_SIZE_LARGE_TOOLBAR)
+ if pixbuf == None:
+ renderer.set_property("visible", False)
+ renderer.set_property("sensitive", False)
+ return
+ renderer.set_property("visible", True)
+ renderer.set_property("sensitive", True)
+ renderer.set_property("pixbuf", pixbuf)
else:
renderer.set_property("visible", True)
renderer.set_property("sensitive", True)
@@ -110,7 +203,8 @@ class EngineComboBox(gtk.ComboBox):
renderer.set_property("pixbuf", pixbuf)
def __name_cell_data_cb(self, celllayout, renderer, model, iter):
- engine = self.__model.get_value(iter, 0)
+ model = self.get_model()
+ engine = model.get_value(iter, 0)
if isinstance (engine, str) or isinstance (engine, unicode):
renderer.set_property("sensitive", False)
@@ -118,8 +212,15 @@ class EngineComboBox(gtk.ComboBox):
renderer.set_property("weight", pango.WEIGHT_NORMAL)
elif isinstance(engine, int):
renderer.set_property("sensitive", True)
- renderer.set_property("text", self.__title)
- renderer.set_property("weight", pango.WEIGHT_NORMAL)
+ if engine == 0:
+ renderer.set_property("text", self.__title)
+ renderer.set_property("weight", pango.WEIGHT_NORMAL)
+ elif engine < 0:
+ if not self.__show_sub_lang:
+ renderer.set_property("text", _("Show all languages"))
+ else:
+ renderer.set_property("text", _("Show frequent used languages only"))
+ renderer.set_property("weight", pango.WEIGHT_BOLD)
else:
renderer.set_property("sensitive", True)
renderer.set_property("text", engine.longname)
@@ -134,13 +235,21 @@ class EngineComboBox(gtk.ComboBox):
if i == 0 or i == -1:
return None
iter = self.get_active_iter()
- return self.get_model()[iter][0]
+ model = self.get_model()
+ if model[iter][0] == -1:
+ self.__show_sub_lang = not self.__show_sub_lang
+ self.__toggle_sub_lang()
+ return None
+ return model[iter][0]
else:
raise AttributeError, 'unknown property %s' % property.name
def get_active_engine(self):
return self.get_property("active-engine")
+ def set_config(self, config):
+ self.__config = config
+
def get_title(self):
return self.__title
diff --git a/setup/main.py b/setup/main.py
index 9cdce02..5201139 100644
--- a/setup/main.py
+++ b/setup/main.py
@@ -226,6 +226,7 @@ class Setup(object):
button.connect("toggled", self.__checkbutton_preload_engine_mode_toggled_cb)
self.__engines = self.__bus.list_engines()
self.__combobox = self.__builder.get_object("combobox_engines")
+ self.__combobox.set_config(self.__config)
self.__combobox.set_engines(self.__engines)
engines = self.__bus.list_active_engines()
--
1.7.4.2

View File

@ -12,8 +12,8 @@
%define gnome_icon_theme_legacy_version 2.91.6
Name: ibus
Version: 1.3.99.20110228
Release: 7%{?dist}
Version: 1.3.99.20110408
Release: 1%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
Group: System Environment/Libraries
@ -23,16 +23,12 @@ Source1: xinput-ibus
%if %have_gjsfile
Source2: http://fujiwara.fedorapeople.org/ibus/gnome-shell/gnome-shell-ibus-plugins-20110317.tar.bz2
%endif
Source3: http://fujiwara.fedorapeople.org/ibus/20110404/ibus-po-20110404.tar.bz2
Patch0: ibus-HEAD.patch
Source3: https://www.transifex.net/projects/p/ibus/resource/master/l/da/download/ibus_master_da.po
# Patch0: ibus-HEAD.patch
Patch1: ibus-435880-surrounding-text.patch
Patch2: ibus-541492-xkb.patch
Patch3: ibus-530711-preload-sys.patch
Patch4: ibus-657165-panel-libs.patch
# This will be removed after the new gnome-shell is integrated.
Patch99: ibus-675503-gnome-shell-workaround.patch
# This will be removed after the gnome-shell ibus patch is integrated.
Patch100: ibus-688034-fedora-g-s.patch
Patch4: ibus-xx-setup-frequent-lang.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -116,6 +112,7 @@ Summary: IBus im module for gtk3
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
Requires: imsettings-gnome
Requires(post): glib2 >= %{glib_ver}
%description gtk3
@ -147,9 +144,8 @@ The ibus-devel-docs package contains developer documentation for ibus
%if %have_gjsfile
bzcat %SOURCE2 | tar xf -
%endif
bzcat %SOURCE3 | tar xf -
%patch0 -p1
%patch99 -p1 -b .g-s-typo
cp %SOURCE3 po/da.po
# %patch0 -p1
# start surrounding patch
%patch1 -p1 -b .surrounding
cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c
@ -158,9 +154,7 @@ cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c
%patch2 -p1 -b .xkb
%endif
%patch3 -p1 -b .preload-sys
%patch4 -p1 -b .panel-libs
# workaround until the ibus feature is integrated into gnome-shell.
%patch100 -p1 -b .fedora-g-s
%patch4 -p1 -b .setup-frequent-lang
%build
%if %have_libxkbfile
@ -334,13 +328,17 @@ fi
%{_datadir}/gtk-doc/html/*
%changelog
* Tue Apr 05 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110228-7
- Updated ibus-HEAD.patch
* Tue Apr 19 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110408-1
- Updated to 1.3.99.20110408
Fixed Bug 683484 - Timed out SetEngine when select an engine from panel.
Fixed Bug 657165 - IBus for gnome-shell for Fedora 15.
- Updated ibus-657165-panel-libs.patch
- Added ibus-688034-fedora-g-s.patch for Fedora workaround.
- Added ibus-po-20110404.tar.bz2 for po files.
- Upstreamed ibus-657165-panel-libs.patch
- Removed ibus-675503-gnome-shell-workaround.patch
- Added ibus-xx-setup-frequent-lang.patch
- Updated ibus-541492-xkb.patch
Fixed Bug 696481 - no the variant maps without language codes
- Added dependency of imsettings-gnome.
Fixed Bug 696510 - need a dependency in ibus-gtk3 for imsettings-gnome
* Thu Mar 10 2011 Takao Fujiwara <tfujiwar@redhat.com> - 1.3.99.20110228-1
- Updated to 1.3.99.20110228

View File

@ -1,3 +1,3 @@
223ce787c5357f833ba34cdaf502ef76 ibus-1.3.99.20110228.tar.gz
6ce34da8e9283d6df076bf6af9bbf815 ibus-1.3.99.20110408.tar.gz
2d6991ca7d3147aa486b6297872bed5f gnome-shell-ibus-plugins-20110317.tar.bz2
6d102835e2cd2efe459fb3c08823e66d ibus-po-20110404.tar.bz2
698c90edf0f037488e1aa969804e891f ibus_master_da.po