summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaohiro Aota <naota@gentoo.org>2013-02-09 16:22:33 +0000
committerNaohiro Aota <naota@gentoo.org>2013-02-09 16:22:33 +0000
commit30e174de6f4c187255fbfffa67bae64619e31f19 (patch)
tree1e8a8aae9fe80cfcd6b7c5731ac39ff29e4185c8 /app-i18n
parentfix logic/syntax of --with-gfxdrivers and --with-inputdrivers, fix bug #45611... (diff)
downloadgentoo-2-30e174de6f4c187255fbfffa67bae64619e31f19.tar.gz
gentoo-2-30e174de6f4c187255fbfffa67bae64619e31f19.tar.bz2
gentoo-2-30e174de6f4c187255fbfffa67bae64619e31f19.zip
Add patch tof ix some upstreamed issues. #455614
(Portage version: 2.2.0_alpha159/cvs/Linux x86_64, signed Manifest commit with key F8551514)
Diffstat (limited to 'app-i18n')
-rw-r--r--app-i18n/ibus/ChangeLog9
-rw-r--r--app-i18n/ibus/files/ibus-1.5.1-queue-events.patch367
-rw-r--r--app-i18n/ibus/files/ibus-1.5.1-setup.patch30
-rw-r--r--app-i18n/ibus/ibus-1.5.1-r1.ebuild173
4 files changed, 578 insertions, 1 deletions
diff --git a/app-i18n/ibus/ChangeLog b/app-i18n/ibus/ChangeLog
index 735b0ae56018..4b59cce07363 100644
--- a/app-i18n/ibus/ChangeLog
+++ b/app-i18n/ibus/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-i18n/ibus
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-i18n/ibus/ChangeLog,v 1.119 2013/02/05 11:03:58 yngwin Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-i18n/ibus/ChangeLog,v 1.120 2013/02/09 16:22:33 naota Exp $
+
+*ibus-1.5.1-r1 (09 Feb 2013)
+
+ 09 Feb 2013; Naohiro Aota <naota@gentoo.org>
+ +files/ibus-1.5.1-queue-events.patch, +files/ibus-1.5.1-setup.patch,
+ +ibus-1.5.1-r1.ebuild:
+ Add patch tof ix some upstreamed issues. #455614
*ibus-1.5.1 (05 Feb 2013)
diff --git a/app-i18n/ibus/files/ibus-1.5.1-queue-events.patch b/app-i18n/ibus/files/ibus-1.5.1-queue-events.patch
new file mode 100644
index 000000000000..38c3fe9865a9
--- /dev/null
+++ b/app-i18n/ibus/files/ibus-1.5.1-queue-events.patch
@@ -0,0 +1,367 @@
+From 62cd0492e3459416e1775aedc327bced53f66828 Mon Sep 17 00:00:00 2001
+From: Rui Matos <tiagomatos@gmail.com>
+Date: Wed, 9 Jan 2013 10:14:55 -0500
+Subject: [PATCH] client: Queue events while the IBus context isn't ready
+
+There are actually 3 patches here.
+
+---
+client: Queue events while the IBus context isn't ready
+
+We may lose events that ought to be processed while the IBus context
+isn't ready or if the connection to IBus isn't fully established yet.
+
+To avoid that, enqueue events to be processed later when the IBus
+context creation finishes.
+
+---
+client: Don't cancel an ongoing create input context on another request
+
+This would only add more delays.
+
+---
+client: Cancel any ongoing create input context request on finalize
+
+BUG=
+
+Review URL: https://codereview.appspot.com/6988047
+Patch from Rui Matos <tiagomatos@gmail.com>.
+---
+ client/gtk2/ibusimcontext.c | 220 ++++++++++++++++++++++++++-----------------
+ 1 file changed, 133 insertions(+), 87 deletions(-)
+
+diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
+index 011676f..94005b7 100644
+--- a/client/gtk2/ibusimcontext.c
++++ b/client/gtk2/ibusimcontext.c
+@@ -40,6 +40,8 @@
+ # define IDEBUG(a...)
+ #endif
+
++#define MAX_QUEUED_EVENTS 20
++
+ struct _IBusIMContext {
+ GtkIMContext parent;
+
+@@ -63,6 +65,7 @@ struct _IBusIMContext {
+
+ /* cancellable */
+ GCancellable *cancellable;
++ GQueue *events_queue;
+ };
+
+ struct _IBusIMContextClass {
+@@ -154,6 +157,8 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ static GtkIMContextClass *parent_class = NULL;
+
+ static IBusBus *_bus = NULL;
++static guint _daemon_name_watch_id = 0;
++static gboolean _daemon_is_running = FALSE;
+
+ void
+ ibus_im_context_register_type (GTypeModule *type_module)
+@@ -261,6 +266,46 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ gdk_event_free ((GdkEvent *)event);
+ }
+
++static gboolean
++_process_key_event (IBusInputContext *context,
++ GdkEventKey *event)
++{
++ guint state = event->state;
++ gboolean retval = FALSE;
++
++ if (event->type == GDK_KEY_RELEASE) {
++ state |= IBUS_RELEASE_MASK;
++ }
++
++ if (_use_sync_mode) {
++ retval = ibus_input_context_process_key_event (context,
++ event->keyval,
++ event->hardware_keycode - 8,
++ state);
++ }
++ else {
++ ibus_input_context_process_key_event_async (context,
++ event->keyval,
++ event->hardware_keycode - 8,
++ state,
++ -1,
++ NULL,
++ _process_key_event_done,
++ gdk_event_copy ((GdkEvent *) event));
++
++ retval = TRUE;
++ }
++
++ if (retval) {
++ event->state |= IBUS_HANDLED_MASK;
++ }
++ else {
++ event->state |= IBUS_IGNORED_MASK;
++ }
++
++ return retval;
++}
++
+
+ /* emit "retrieve-surrounding" glib signal of GtkIMContext, if
+ * context->caps has IBUS_CAP_SURROUNDING_TEXT and the current IBus
+@@ -387,38 +432,7 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ ibusimcontext->time = event->time;
+ }
+
+- guint state = event->state;
+- if (event->type == GDK_KEY_RELEASE) {
+- state |= IBUS_RELEASE_MASK;
+- }
+-
+- if (_use_sync_mode) {
+- retval = ibus_input_context_process_key_event (
+- ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state);
+- }
+- else {
+- ibus_input_context_process_key_event_async (
+- ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state,
+- -1,
+- NULL,
+- _process_key_event_done,
+- gdk_event_copy ((GdkEvent *) event));
+- retval = TRUE;
+-
+- }
+-
+- if (retval) {
+- event->state |= IBUS_HANDLED_MASK;
+- }
+- else {
+- event->state |= IBUS_IGNORED_MASK;
+- }
++ retval = _process_key_event (ibuscontext, event);
+
+ if (ibusimcontext != NULL) {
+ /* unref ibusimcontext could call ibus_im_context_finalize here
+@@ -450,6 +464,23 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ }
+
+ static void
++daemon_name_appeared (GDBusConnection *connection,
++ const gchar *name,
++ const gchar *owner,
++ gpointer data)
++{
++ _daemon_is_running = TRUE;
++}
++
++static void
++daemon_name_vanished (GDBusConnection *connection,
++ const gchar *name,
++ gpointer data)
++{
++ _daemon_is_running = FALSE;
++}
++
++static void
+ ibus_im_context_class_init (IBusIMContextClass *class)
+ {
+ IDEBUG ("%s", __FUNCTION__);
+@@ -533,6 +564,14 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ /* always install snooper */
+ if (_key_snooper_id == 0)
+ _key_snooper_id = gtk_key_snooper_install (_key_snooper_cb, NULL);
++
++ _daemon_name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
++ IBUS_SERVICE_IBUS,
++ G_BUS_NAME_WATCHER_FLAGS_NONE,
++ daemon_name_appeared,
++ daemon_name_vanished,
++ NULL,
++ NULL);
+ }
+
+ static void
+@@ -543,6 +582,8 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ gtk_key_snooper_remove (_key_snooper_id);
+ _key_snooper_id = 0;
+ }
++
++ g_bus_unwatch_name (_daemon_name_watch_id);
+ }
+
+ /* Copied from gtk+2.0-2.20.1/modules/input/imcedilla.c to fix crosbug.com/11421.
+@@ -602,6 +643,7 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS;
+ #endif
+
++ ibusimcontext->events_queue = g_queue_new ();
+
+ // Create slave im context
+ ibusimcontext->slave = gtk_im_context_simple_new ();
+@@ -651,6 +693,13 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+
+ g_signal_handlers_disconnect_by_func (_bus, G_CALLBACK (_bus_connected_cb), obj);
+
++ if (ibusimcontext->cancellable != NULL) {
++ /* Cancel any ongoing create input context request */
++ g_cancellable_cancel (ibusimcontext->cancellable);
++ g_object_unref (ibusimcontext->cancellable);
++ ibusimcontext->cancellable = NULL;
++ }
++
+ if (ibusimcontext->ibuscontext) {
+ ibus_proxy_destroy ((IBusProxy *)ibusimcontext->ibuscontext);
+ }
+@@ -670,6 +719,9 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ pango_attr_list_unref (ibusimcontext->preedit_attrs);
+ }
+
++ g_queue_free_full (ibusimcontext->events_queue,
++ (GDestroyNotify)gdk_event_free);
++
+ G_OBJECT_CLASS(parent_class)->finalize (obj);
+ }
+
+@@ -681,65 +733,56 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+
+ IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context);
+
+- if (G_LIKELY (ibusimcontext->ibuscontext && ibusimcontext->has_focus)) {
+- /* If context does not have focus, ibus will process key event in sync mode.
+- * It is a workaround for increase search in treeview.
+- */
+- gboolean retval = FALSE;
+-
+- if (event->state & IBUS_HANDLED_MASK)
+- return TRUE;
++ if (!_daemon_is_running)
++ return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+
+- if (event->state & IBUS_IGNORED_MASK)
+- return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
++ /* If context does not have focus, ibus will process key event in
++ * sync mode. It is a workaround for increase search in treeview.
++ */
++ if (!ibusimcontext->has_focus)
++ return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+
+- /* XXX it is a workaround for some applications do not set client window. */
+- if (ibusimcontext->client_window == NULL && event->window != NULL)
+- gtk_im_context_set_client_window ((GtkIMContext *)ibusimcontext, event->window);
++ if (event->state & IBUS_HANDLED_MASK)
++ return TRUE;
+
+- _request_surrounding_text (ibusimcontext);
++ if (event->state & IBUS_IGNORED_MASK)
++ return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+
+- if (ibusimcontext != NULL) {
+- ibusimcontext->time = event->time;
+- }
++ /* XXX it is a workaround for some applications do not set client
++ * window. */
++ if (ibusimcontext->client_window == NULL && event->window != NULL)
++ gtk_im_context_set_client_window ((GtkIMContext *)ibusimcontext,
++ event->window);
+
+- guint state = event->state;
+- if (event->type == GDK_KEY_RELEASE) {
+- state |= IBUS_RELEASE_MASK;
+- }
++ _request_surrounding_text (ibusimcontext);
+
+- if (_use_sync_mode) {
+- retval = ibus_input_context_process_key_event (
+- ibusimcontext->ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state);
+- }
+- else {
+- ibus_input_context_process_key_event_async (
+- ibusimcontext->ibuscontext,
+- event->keyval,
+- event->hardware_keycode - 8,
+- state,
+- -1,
+- NULL,
+- _process_key_event_done,
+- gdk_event_copy ((GdkEvent *) event));
+- retval = TRUE;
+- }
++ ibusimcontext->time = event->time;
+
+- if (retval) {
+- event->state |= IBUS_HANDLED_MASK;
++ if (ibusimcontext->ibuscontext) {
++ if (_process_key_event (ibusimcontext->ibuscontext, event))
+ return TRUE;
+- }
+- else {
+- event->state |= IBUS_IGNORED_MASK;
+- return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
+- }
++ else
++ return gtk_im_context_filter_keypress (ibusimcontext->slave,
++ event);
+ }
+- else {
+- return gtk_im_context_filter_keypress (ibusimcontext->slave, event);
++
++ /* At this point we _should_ be waiting for the IBus context to be
++ * created or the connection to IBus to be established. If that's
++ * the case we queue events to be processed when the IBus context
++ * is ready. */
++ g_return_val_if_fail (ibusimcontext->cancellable != NULL ||
++ ibus_bus_is_connected (_bus) == FALSE,
++ FALSE);
++ g_queue_push_tail (ibusimcontext->events_queue,
++ gdk_event_copy ((GdkEvent *)event));
++
++ if (g_queue_get_length (ibusimcontext->events_queue) > MAX_QUEUED_EVENTS) {
++ g_warning ("Events queue growing too big, will start to drop.");
++ gdk_event_free ((GdkEvent *)
++ g_queue_pop_head (ibusimcontext->events_queue));
+ }
++
++ return TRUE;
+ }
+
+ static void
+@@ -1482,6 +1525,14 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+ ibus_input_context_focus_in (ibusimcontext->ibuscontext);
+ _set_cursor_location_internal (ibusimcontext);
+ }
++
++ if (!g_queue_is_empty (ibusimcontext->events_queue)) {
++ GdkEventKey *event;
++ while (event = g_queue_pop_head (ibusimcontext->events_queue)) {
++ _process_key_event (context, event);
++ gdk_event_free ((GdkEvent *)event);
++ }
++ }
+ }
+
+ g_object_unref (ibusimcontext);
+@@ -1494,12 +1545,7 @@ static void _slave_preedit_end_cb (GtkIMContext *slave,
+
+ g_assert (ibusimcontext->ibuscontext == NULL);
+
+- if (ibusimcontext->cancellable != NULL) {
+- /* Cancel previous create input context request */
+- g_cancellable_cancel (ibusimcontext->cancellable);
+- g_object_unref (ibusimcontext->cancellable);
+- ibusimcontext->cancellable = NULL;
+- }
++ g_return_if_fail (ibusimcontext->cancellable == NULL);
+
+ ibusimcontext->cancellable = g_cancellable_new ();
+
+--
+1.7.10
+
diff --git a/app-i18n/ibus/files/ibus-1.5.1-setup.patch b/app-i18n/ibus/files/ibus-1.5.1-setup.patch
new file mode 100644
index 000000000000..54d0f35a2e72
--- /dev/null
+++ b/app-i18n/ibus/files/ibus-1.5.1-setup.patch
@@ -0,0 +1,30 @@
+From 8ac534fc002356b93e2015a8866f1ea89e3895f9 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Sat, 15 Dec 2012 17:40:18 +0900
+Subject: [PATCH] Use Variant.unpack() instead of Variant.dup_strv().
+
+Variant.dup_strv() returns a tuple in pygobject 3.2, e.g. (['<Control>space'], 1L), and a list in pygobject 3.4, e.g. ['<Control>space'] .
+
+BUG=RH#887153
+
+Review URL: https://codereview.appspot.com/6941051
+---
+ setup/main.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup/main.py b/setup/main.py
+index a8acc7a..707faa4 100644
+--- a/setup/main.py
++++ b/setup/main.py
+@@ -87,7 +87,7 @@ def __init_hotkey(self):
+ label = 'switch_engine'
+ variant = self.__config.get_value('general/hotkey', name)
+ if variant != None:
+- shortcuts = variant.dup_strv()
++ shortcuts = variant.unpack()
+ else:
+ shortcuts = ['<Control>space']
+
+--
+1.7.10
+
diff --git a/app-i18n/ibus/ibus-1.5.1-r1.ebuild b/app-i18n/ibus/ibus-1.5.1-r1.ebuild
new file mode 100644
index 000000000000..d8dacc807677
--- /dev/null
+++ b/app-i18n/ibus/ibus-1.5.1-r1.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-i18n/ibus/ibus-1.5.1-r1.ebuild,v 1.1 2013/02/09 16:22:33 naota Exp $
+
+EAPI=4
+PYTHON_DEPEND="python? 2:2.5"
+VALA_MIN_API_VERSION="0.18"
+VALA_USE_DEPEND="vapigen"
+# Vapigen is needed for the vala binding
+# Valac is needed when building from git for the engine
+
+inherit eutils gnome2-utils multilib python vala virtualx
+
+DESCRIPTION="Intelligent Input Bus for Linux / Unix OS"
+HOMEPAGE="http://code.google.com/p/ibus/"
+SRC_URI="http://ibus.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="dconf deprecated +gconf gtk +gtk3 +introspection nls +python test vala +X"
+REQUIRED_USE="|| ( gtk gtk3 X )
+ deprecated? ( python )
+ python? ( || ( deprecated ( gtk3 introspection ) ) )" #342903
+
+COMMON_DEPEND=">=dev-libs/glib-2.26:2
+ gnome-base/librsvg:2
+ sys-apps/dbus[X?]
+ app-text/iso-codes
+
+ dconf? ( >=gnome-base/dconf-0.13.4 )
+ gconf? ( >=gnome-base/gconf-2.12:2 )
+ gtk? ( x11-libs/gtk+:2 )
+ gtk3? ( x11-libs/gtk+:3 )
+ X? (
+ x11-libs/libX11
+ x11-libs/gtk+:2 )
+ introspection? ( >=dev-libs/gobject-introspection-0.6.8 )
+ nls? ( virtual/libintl )"
+RDEPEND="${COMMON_DEPEND}
+ python? (
+ dev-python/pyxdg
+ deprecated? (
+ >=dev-python/dbus-python-0.83
+ dev-python/pygobject:2
+ dev-python/pygtk:2 )
+ gtk3? (
+ dev-python/pygobject:3
+ x11-libs/gdk-pixbuf:2[introspection]
+ x11-libs/pango[introspection]
+ x11-libs/gtk+:3[introspection] )
+ )"
+DEPEND="${COMMON_DEPEND}
+ >=dev-lang/perl-5.8.1
+ dev-util/gtk-doc-am
+ dev-util/intltool
+ virtual/pkgconfig
+ nls? ( >=sys-devel/gettext-0.16.1 )
+ vala? ( $(vala_depend) )"
+
+# stress test in bus/ fails
+# IBUS-CRITICAL **: bus_test_client_init: assertion `ibus_bus_is_connected (_bus)' failed
+RESTRICT="test"
+
+DOCS="AUTHORS ChangeLog NEWS README"
+
+pkg_setup() {
+ if use python; then
+ python_set_active_version 2
+ python_pkg_setup
+ fi
+}
+
+src_prepare() {
+ # We run "dconf update" in pkg_postinst/postrm to avoid sandbox violations
+ sed -e 's/dconf update/$(NULL)/' \
+ -i data/dconf/Makefile.{am,in} || die
+ use python && python_clean_py-compile_files
+ use vala && vala_src_prepare
+ epatch "${FILESDIR}"/${P}-setup.patch \
+ "${FILESDIR}"/${P}-queue-events.patch
+ cp "${S}"/client/gtk2/ibusimcontext.c "${S}"/client/gtk3/ibusimcontext.c || die
+}
+
+src_configure() {
+ local python_conf
+ if use python; then
+ # We cannot call $(PYTHON) if we haven't called python_pkg_setup
+ python_conf="PYTHON=$(PYTHON)
+ $(use_enable deprecated python-library)
+ $(use_enable gtk3 setup)"
+ else
+ python_conf="--disable-python-library --disable-setup"
+ fi
+ econf \
+ $(use_enable dconf) \
+ $(use_enable introspection) \
+ $(use_enable gconf) \
+ $(use_enable gtk gtk2) \
+ $(use_enable gtk xim) \
+ $(use_enable gtk3) \
+ $(use_enable gtk3 ui) \
+ $(use_enable nls) \
+ $(use_enable test tests) \
+ $(use_enable vala) \
+ $(use_enable X xim) \
+ ${python_conf}
+}
+
+src_test() {
+ unset DBUS_SESSION_BUS_ADDRESS
+ Xemake check || die
+}
+
+src_install() {
+ default
+
+ find "${ED}" -name '*.la' -exec rm -f {} +
+
+ insinto /etc/X11/xinit/xinput.d
+ newins xinput-ibus ibus.conf
+
+ keepdir /usr/share/ibus/{engine,icons} #289547
+}
+
+pkg_preinst() {
+ use gconf && gnome2_gconf_savelist
+ gnome2_icon_savelist
+}
+
+pkg_postinst() {
+ if use dconf; then
+ ebegin "Updating dconf system databases"
+ dconf update
+ eend $?
+ fi
+ use gconf && gnome2_gconf_install
+ use gtk && gnome2_query_immodules_gtk2
+ use gtk3 && gnome2_query_immodules_gtk3
+ use deprecated && python_mod_optimize ${PN}
+ use python && use gtk3 && python_mod_optimize /usr/share/${PN}
+ gnome2_icon_cache_update
+
+ elog "To use ibus, you should:"
+ elog "1. Get input engines from sunrise overlay."
+ elog " Run \"emerge -s ibus-\" in your favorite terminal"
+ elog " for a list of packages we already have."
+ elog
+ elog "2. Setup ibus:"
+ elog
+ elog " $ ibus-setup"
+ elog
+ elog "3. Set the following in your user startup scripts"
+ elog " such as .xinitrc, .xsession or .xprofile:"
+ elog
+ elog " export XMODIFIERS=\"@im=ibus\""
+ elog " export GTK_IM_MODULE=\"ibus\""
+ elog " export QT_IM_MODULE=\"xim\""
+ elog " ibus-daemon -d -x"
+}
+
+pkg_postrm() {
+ if use dconf; then
+ ebegin "Updating dconf system databases"
+ dconf update
+ eend $?
+ fi
+ use gtk && gnome2_query_immodules_gtk2
+ use gtk3 && gnome2_query_immodules_gtk3
+ use deprecated && python_mod_cleanup ${PN}
+ use python && use gtk3 && python_mod_cleanup /usr/share/${PN}
+ gnome2_icon_cache_update
+}