platform/upstream/ibus.git
13 years agoLink appropriate libraries to ibus-scan.
Yusuke Sato [Tue, 22 Mar 2011 13:36:52 +0000 (22:36 +0900)]
Link appropriate libraries to ibus-scan.

TEST=git clone the clean tree, ran ./autogen.sh --enable-gtk-doc, then ran make.

Review URL: http://codereview.appspot.com/4289060

13 years agoAdd asynchronous InputContext.IsEnabled and InputContext.GetEngine APIs.
Yusuke Sato [Tue, 22 Mar 2011 05:09:34 +0000 (14:09 +0900)]
Add asynchronous InputContext.IsEnabled and InputContext.GetEngine APIs.

* Added asynchronous InputContext.IsEnabled and InputContext.GetEngine APIs. Now
all InputContext IPCs can be async.
* Added comments to src/ibusinputcontext.h.
* Moved input context tests from ibus-bus.c to ibus-inputcontext.c (new file),
and fixed flaky tests.
* Fixed typos in bus/.

BUG=http://code.google.com/p/ibus/issues/detail?id=1215
TEST=ran the new test

Review URL: http://codereview.appspot.com/4298049

13 years agoCreate a separate test case for ibus_bus_create_input_context_async().
Peng Huang [Fri, 18 Mar 2011 13:24:18 +0000 (09:24 -0400)]
Create a separate test case for ibus_bus_create_input_context_async().

Create a separate test case for ibus_bus_create_input_context_async(),
so we can use `ibus-bus -p /ibus/create-input-context' to test and debug
ibus_bus_create_input_context_async() only.

BUG=none
TEST=make check

Review URL: http://codereview.appspot.com/4298045

13 years agoRefine document and coding style in ibusbus.[ch] and trim some private structs and...
Peng Huang [Thu, 17 Mar 2011 14:52:38 +0000 (10:52 -0400)]
Refine document and coding style in ibusbus.[ch] and trim some private structs and api from document

BUG=none
TEST=make

Review URL: http://codereview.appspot.com/4290053

13 years agoDo not block UI in IBusIMContext anymore.
Peng Huang [Thu, 17 Mar 2011 14:49:03 +0000 (10:49 -0400)]
Do not block UI in IBusIMContext anymore.

Replace some block IPC calls with async IPC calls, and then IBusIMContext will
not block UI anymore.

BUG=http://crosbug.com/12310
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4287054

13 years agoFix issue of InputContext.SetEngine.
Peng Huang [Wed, 16 Mar 2011 14:02:47 +0000 (10:02 -0400)]
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

13 years agoAdd git.mk from gtk+ project, Use it to update .gitignore
Peng Huang [Wed, 16 Mar 2011 14:01:18 +0000 (10:01 -0400)]
Add git.mk from gtk+ project, Use it to update .gitignore

BUG=none
TEST=make

Review URL: http://codereview.appspot.com/4280050

13 years agoUpdate gtk-doc
Peng Huang [Tue, 15 Mar 2011 17:32:55 +0000 (13:32 -0400)]
Update gtk-doc

BUG=
TEST=Linux documemt

Review URL: http://codereview.appspot.com/4277054

13 years agoThis can cause crashes on cleanup when multiple components are implemented in the...
Zach Kuznia [Mon, 14 Mar 2011 06:42:32 +0000 (15:42 +0900)]
This can cause crashes on cleanup when multiple components are implemented in the same process.

Review URL: http://codereview.appspot.com/4241058
Patch from Zach Kuznia <zork@chromium.org>.

13 years agoFix preedit_string = NULL in ibus-x11 _free_ic()
fujiwarat [Fri, 11 Mar 2011 06:53:53 +0000 (15:53 +0900)]
Fix preedit_string = NULL in ibus-x11 _free_ic()

13 years agoFix make check error
Peng Huang [Fri, 11 Mar 2011 15:37:40 +0000 (10:37 -0500)]
Fix make check error

BUG=none
TEST=make check

Review URL: http://codereview.appspot.com/4250077

13 years agoUpdate symbols file.
Yusuke Sato [Wed, 9 Mar 2011 23:44:38 +0000 (08:44 +0900)]
Update symbols file.

./autogen.sh
./configure --enable-gtk-doc
make dpkg
cp ppa/ibus-1.3.99.20110309/debian/libibus-1.0-0/DEBIAN/symbols debian/libibus-1.0-0.symbols
vi debian/libibus-1.0-0.symbols  # remove "-1phuang1~maverick1"
make dpkg  # confirm that lintian does not report an error.

Review URL: http://codereview.appspot.com/4253068

13 years agoFix issues of the "previous_engine" hotkey.
Yusuke Sato [Wed, 15 Sep 2010 03:25:17 +0000 (12:25 +0900)]
Fix issues of the "previous_engine" hotkey.

Check global_previous_engine_name when the previous engine is requested and rewrite it if necessary.
This change ensures that the "previous_engine" hotkey (Ctrl+space on Chrome OS) always works
whenever two or more engines are preloaded.

Currently, Ctrl+space could become NOP by the following scenarios (http://crosbug.com/6609):

(1)
1. preload engines A, B, C.
2. switch to A.
3. switch to B.
4. at this point, ctrl+space works fine. It selectes A and B alternately.
5. switch to A.
6. remove B from the preloaded engline list.
7. at this point, ctrl+space suddenly becomes NOP although C is still preloaded.
This is because the callback function of ctrl+space detects
global_previous_engine_name (i.e. B) is removed and automatically selects A (not
C) as a global_previous_engine_name.

(2)
1. preload engines A, B.
2. switch to A.
3. switch to B.
4. at this point, ctrl+space works fine. It selectes A and B alternately.
5. switch to A.
6. remove B from the preloaded engline list.
7. press ctrl+space several times, confirm that nothing happens (this is
expected since only one engine, A, is preloaded).
8. preload additional engine, C.
9. at this point, ctrl+space is still NOP although two engines, A and C, are
preloaded.

13 years agoIf the current engine is removed, then switch to another engine automatically.
James Su [Thu, 27 May 2010 05:31:06 +0000 (22:31 -0700)]
If the current engine is removed, then switch to another engine automatically.

BUG=http://crosbug.com/3577
TEST=manual test.

Review URL: http://codereview.chromium.org/2259004

13 years agoRemove -Wall warnings.
Yusuke Sato [Tue, 8 Mar 2011 12:57:10 +0000 (21:57 +0900)]
Remove -Wall warnings.

Review URL: http://codereview.appspot.com/4261056

13 years agoAdd asynchronous APIs to ibusbus.h
Yusuke Sato [Mon, 7 Mar 2011 15:55:36 +0000 (00:55 +0900)]
Add asynchronous APIs to ibusbus.h

Modified src/tests/ibus-bus.c so that it could be compiled with ibus-1.3.99 as well.

BUG=chromium-os:12581
TEST=added async api tests to the src/tests/ibus-bus.c and ran it locally.

Review URL: http://codereview.appspot.com/4179061

13 years agoMove gtk_key_snooper_remove from function object_fini to class_fini.
Peng Huang [Mon, 7 Mar 2011 15:26:04 +0000 (10:26 -0500)]
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

13 years agoOptimize focus_in to avoid call some UI blocking functions.
Peng Huang [Tue, 1 Mar 2011 20:34:37 +0000 (15:34 -0500)]
Optimize focus_in to avoid call some UI blocking functions.

focus_in calls some X blocking functions. It will block UI. This change delays the X blocking calls to idle callback, to avoid blocking UI.

BUG=http://crbug.com/74237
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4254048

13 years agoUnify async and sync function names.
Peng Huang [Mon, 28 Feb 2011 20:57:47 +0000 (15:57 -0500)]
Unify async and sync function names.

BUG=none
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4246042

13 years agoFix a race problem in SetGlobalEngine and add set_global_engine in python library
Peng Huang [Mon, 28 Feb 2011 15:25:54 +0000 (10:25 -0500)]
Fix a race problem in SetGlobalEngine and add set_global_engine in python library

The race problem:
 1. global engine == A
 2. call SetGlobalEngine(B) asynchronously
 3. call SetGlobalEngine(A) immediately
  3.1 Because step 2 is not finished, so the global engine is still A,
      and SetGlobalEngine(A) returns sucessfully.
 4. SetGlobalEngine(B) is completed and the global engine becomes B

BUG=http://crosbug.com/12414
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4250041

13 years agoCall gtk_key_snooper_remove when GTK IM client is switched.
fujiwarat [Fri, 18 Feb 2011 19:52:40 +0000 (04:52 +0900)]
Call gtk_key_snooper_remove when GTK IM client is switched.

13 years agoFix make dpkg errors.
Peng Huang [Fri, 18 Feb 2011 15:59:49 +0000 (10:59 -0500)]
Fix make dpkg errors.

BUG=none
TEST=make dpkg

Review URL: http://codereview.appspot.com/4184055

13 years agoAdd enable_conditional and disable_conditional in gconf schemas file
Peng Huang [Fri, 18 Feb 2011 15:59:06 +0000 (10:59 -0500)]
Add enable_conditional and disable_conditional in gconf schemas file

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/4183057

13 years agoFix crash when turn off "use global engine" option
Peng Huang [Fri, 18 Feb 2011 15:58:27 +0000 (10:58 -0500)]
Fix crash when turn off "use global engine" option

BUG=none
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4170061

13 years agoDestroy IBusInputContext correctly in ibus-x11
Peng Huang [Fri, 18 Feb 2011 14:08:41 +0000 (09:08 -0500)]
Destroy IBusInputContext correctly in ibus-x11

BUG=none
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4178062

13 years agos/LC_MESSAGES/LC_CTYPE/ in set_default_preload_engines.
fujiwarat [Thu, 17 Feb 2011 06:08:37 +0000 (15:08 +0900)]
s/LC_MESSAGES/LC_CTYPE/ in set_default_preload_engines.

13 years agoDo not create GSimpleAsyncResult in ibus_input_context_process_key_event
Peng Huang [Wed, 16 Feb 2011 20:49:09 +0000 (15:49 -0500)]
Do not create GSimpleAsyncResult in ibus_input_context_process_key_event

This change also fixes memory leak of simple result object

BUG=none
TEST=Linux desktop

Review URL: http://codereview.appspot.com/4175051

13 years agoAdd async version of set_global_engine.
Yusuke Sato [Wed, 16 Feb 2011 14:42:27 +0000 (23:42 +0900)]
Add async version of set_global_engine.

Patch from Zach Kuznia <zork@chromium.org>, modified by Yusuke Sato <yusukes@chromium.org>.

Review URL: http://codereview.appspot.com/4175047

13 years agoImplement async version of ibus_config_set_value.
Yusuke Sato [Wed, 16 Feb 2011 06:45:29 +0000 (15:45 +0900)]
Implement async version of ibus_config_set_value.

BUG=crosbug.com/11903

Review URL: http://codereview.appspot.com/4185041

13 years agoAdd engine_name parameter to the global-engine-changed signal.
Yusuke Sato [Tue, 15 Feb 2011 07:44:05 +0000 (16:44 +0900)]
Add engine_name parameter to the global-engine-changed signal.

This makes it possible for a client to know the current global engine w/o issuing GetGlobalEngine reqeust.

BUG=chromium-os:11908

Review URL: http://codereview.appspot.com/4177045

13 years agoUse LC_MESSAGES instead of LC_ALL in bus_ibus_impl_set_default_preload_engines.
Yusuke Sato [Tue, 15 Feb 2011 01:27:03 +0000 (10:27 +0900)]
Use LC_MESSAGES instead of LC_ALL in bus_ibus_impl_set_default_preload_engines.

This is a fix for https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/716314. Calling setlocale(LC_ALL, NULL); in the function seems not to be a good idea since the function could return a complex string like "LC_CTYPE=ja_JP.UTF-8;LC_NUMERIC=C;LC..." when two or more values are used for LC_xxx variables (e.g. ja_JP.UTF-8 and C.)

BUG=1204

Review URL: http://codereview.appspot.com/4160046

13 years agoNever use ibus's US keymap in bus_input_context_filter_key, and use the keyval from...
Yusuke Sato [Tue, 15 Feb 2011 01:24:20 +0000 (10:24 +0900)]
Never use ibus's US keymap in bus_input_context_filter_key, and use the keyval from X as-is.
I think this is important for supporting non-US keyboards like a Japanese-106 keyboard correctly.

Currently, when use_sys_layout config is unchecked (the default), ibus-daemon discards a keyval being passed from X, and regenerates a keyval from a keycode assuming the US layout.

However, I believe this behavior is not good for non-US keyboard layout users (e.g. Japanese or Korean keyboard users.) For example, the Japanese 106 keyboard has a key called Zenkaku_Hankaku (全角_半角, whose keycode is 49) on the left hand of the '1' key, and most users want to use the key for toggling IME. But, even if a user set 'Zenkaku_Hankaku' as the toggle hotkey using ibus-setup, the user cannot toggle IME unless the 'Use system keyboard layout' option is explicitly turned on. This is because when use_sys_layout is unchecked, ibus-daemon treats the Zenkaku_Hankaku key press (keycode=49) as tilde (~) key press (remember that the tilde's keycode is also 49 in the US keyboard layout.) This is very inconvenient and confusing.

Please also note that the hotkey configuration tool in ibus-setup always respects a keyval from X, and never checks the use_sys_layout value.

Review URL: http://codereview.appspot.com/4173046

13 years agoAlways call g_simple_async_result_complete in ibus_input_context_process_key_event_do...
Yusuke Sato [Tue, 15 Feb 2011 01:22:48 +0000 (10:22 +0900)]
Always call g_simple_async_result_complete in ibus_input_context_process_key_event_done in order to handle IPC errors correctly.

Review URL: http://codereview.appspot.com/4171049

13 years agoFix compiler warnings in util/IMdkit/.
Ahmad Sharif [Sat, 12 Feb 2011 14:38:35 +0000 (23:38 +0900)]
Fix compiler warnings in util/IMdkit/.

BUG=1201

Review URL: http://codereview.appspot.com/4171046
Patch from Ahmad Sharif <asharif@chromium.org>.

13 years agoRan 'make update-po' in po/.
Yusuke Sato [Sat, 12 Feb 2011 13:56:49 +0000 (22:56 +0900)]
Ran 'make update-po' in po/.

BUG=1173

Review URL: http://codereview.appspot.com/4181044

13 years agoReimplement ibus_bus_watch_dbus_signal for GDBus and export it.
Yusuke Sato [Fri, 11 Feb 2011 14:53:34 +0000 (23:53 +0900)]
Reimplement ibus_bus_watch_dbus_signal for GDBus and export it.

BUG=crosbug.com/11479

Review URL: http://codereview.appspot.com/4186041

13 years agoSupport enable/disable hotkeys that enable or disable ibus unconditionally (i.e....
Yusuke Sato [Fri, 11 Feb 2011 14:48:42 +0000 (23:48 +0900)]
Support enable/disable hotkeys that enable or disable ibus unconditionally (i.e. not toggle.)

I'll update ibus/po/*po files if the change looks good to you.

BUG=http://code.google.com/p/ibus/issues/detail?id=1173
TEST=manually

Review URL: http://codereview.appspot.com/3807047

13 years agoFix ibus-daemon deadlock in engineproxy.c.
phuang [Wed, 9 Feb 2011 12:02:44 +0000 (21:02 +0900)]
Fix ibus-daemon deadlock in engineproxy.c.

How to reproduce the deadlock on a desktop Linux like Ubuntu Maverick:

1. Add 20 seconds sleep in the beginning of the main() function of an engine (e.g. ibus-engine-mozc). See http://crosbug.com/11379#c16 .
2. Set preload_engines to "mozc" using ibus-setup.
3. Start ibus-daemon.
4. press the trigger hotkey twice within the 20 seconds.

Expected:
The second trigger hotkey press cancels the bus_engine_proxy_new operation started by the first one.

Actual:
ibus-daemon freezes. Stack trace: http://crosbug.com/11379#c20

BUG=http://crosbug.com/11379
TEST=see the steps above.

Review URL: http://codereview.appspot.com/4125053
Patch from phuang <shawn.p.huang@gmail.com>.

13 years agoAdd pkgdatadir in ibus-1.0.pc.in
fujiwarat [Tue, 8 Feb 2011 15:51:39 +0000 (00:51 +0900)]
Add pkgdatadir in ibus-1.0.pc.in

13 years agoAdd GTK3 definitions.
fujiwarat [Tue, 8 Feb 2011 15:50:44 +0000 (00:50 +0900)]
Add GTK3 definitions.

13 years agoFix typo.
fujiwarat [Tue, 8 Feb 2011 15:50:56 +0000 (00:50 +0900)]
Fix typo.

13 years agoOverwrite Gtk+'s default compose table to fix crosbug.com/11421.
Yusuke Sato [Thu, 3 Feb 2011 01:15:24 +0000 (10:15 +0900)]
Overwrite Gtk+'s default compose table to fix crosbug.com/11421.

BUG=chromium-os:11421
TEST=manually done on Chrome OS.

Review URL: http://codereview.appspot.com/3989060

13 years agoFix build debian package error.
Peng Huang [Thu, 27 Jan 2011 23:01:34 +0000 (18:01 -0500)]
Fix build debian package error.

BUG=
TEST=make dpkg

Review URL: http://codereview.appspot.com/4013046

13 years agoExport async version ibus_input_context_process_key_event.
Peng Huang [Thu, 27 Jan 2011 15:06:09 +0000 (10:06 -0500)]
Export async version ibus_input_context_process_key_event.

Some application may want to integrate with ibus directly, and want to
use async mode for processing key events. So I make
ibus_input_context_process_key_event to be an async function,
and also added ibus_input_context_process_key_event_sync.

Fix problem in introspection of Engine.

BUG=none
TEST=Tested in Ubuntu 10.10

Review URL: http://codereview.appspot.com/4032044

13 years agoFix problem in introspection of Engine.
Peng Huang [Thu, 27 Jan 2011 00:18:05 +0000 (19:18 -0500)]
Fix problem in introspection of Engine.

BUG=http://code.google.com/p/ibus/issues/detail?id=1194
TEST=Tested in Ubuntu 10.10

Review URL: http://codereview.appspot.com/4084046

13 years agoFix introspection definitions.
fujiwarat [Wed, 26 Jan 2011 04:15:08 +0000 (13:15 +0900)]
Fix introspection definitions.

13 years agoSet QT_IM_MODULE=xim in case of no ibus-qt.
fujiwarat [Wed, 26 Jan 2011 05:01:25 +0000 (14:01 +0900)]
Set QT_IM_MODULE=xim in case of no ibus-qt.

13 years agoAdd signals in IBusPanelService for non-C classes.
fujiwarat [Wed, 26 Jan 2011 05:01:17 +0000 (14:01 +0900)]
Add signals in IBusPanelService for non-C classes.

13 years agoSet GdkEventKey time for gdk_event_put with IBUS_FORWARD_MASK.
fujiwarat [Mon, 24 Jan 2011 03:25:48 +0000 (12:25 +0900)]
Set GdkEventKey time for gdk_event_put with IBUS_FORWARD_MASK.

13 years agoAdd <signal name='ValueChanged'> to introspection_xml in src/ibusconfigservice.c.
Yusuke Sato [Mon, 24 Jan 2011 01:56:05 +0000 (10:56 +0900)]
Add <signal name='ValueChanged'> to introspection_xml in src/ibusconfigservice.c.

I don't think that GDBus library in glib-2.26.[01] uses the information to filter out undefined signals, but just in case.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/4015043

13 years agoFix some race conditions during create engine, also fix dpkg build error.
Peng Huang [Fri, 21 Jan 2011 15:57:54 +0000 (10:57 -0500)]
Fix some race conditions during create engine, also fix dpkg build error.

BUG=chromium-os:10750
TEST=on Linux desktop

Review URL: http://codereview.appspot.com/3970044

13 years agoEmit the connected signal after setting up the connection.
Yusuke Sato [Fri, 21 Jan 2011 12:03:23 +0000 (21:03 +0900)]
Emit the connected signal after setting up the connection.

Otherwise, we might miss the first a few DBus and IBus signals.

BUG=http://crosbug.com/11144
TEST=see the bug.

Review URL: http://codereview.appspot.com/4029043

13 years agoFix race condition between ibus_bus_set_global_engine() and ibus_bus_get_global_engine().
Yusuke Sato [Wed, 19 Jan 2011 01:55:16 +0000 (10:55 +0900)]
Fix race condition between ibus_bus_set_global_engine() and ibus_bus_get_global_engine().

If focus moves between the two API calls, ibus_bus_get_global_engine() might return an unexpected engine name:

1. context A is focused, and the current global engine is "X".
2. ibus_bus_set_global_engine("Y") is called.
3. a user moves the focus from A to B. First, A's engine is set to NULL in bus_ibus_impl_set_focused_context(). Then, in the same function, B's engine is set to "X" (not "Y") since the _ibus_set_global_engine asynchronous call is not finished yet.
4. ibus_bus_set_global_engine("Y") async call successfully finishes. Context A's (not B's) engine is set to "Y", but context B, which has a focus, is not updated.
5. ibus_bus_get_global_engine() is called.

expected:
Y is returned.

actual:
X is returned. Since the context B has a focus, and B's engine is X.

BUG=http://crosbug.com/11031
TEST=see the bug

Review URL: http://codereview.appspot.com/4063041

13 years agoDo not allow clients to destroy the server-side config service for safety.
Yusuke Sato [Wed, 19 Jan 2011 01:18:13 +0000 (10:18 +0900)]
Do not allow clients to destroy the server-side config service for safety.

Unset the own flag of priv->config so that the config proxy object never destroys the config service even if a client wrongly unref()s the priv->config object.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/4060041

13 years agoFix possible SEGV in ibus_bus_get_global_engine.
Yusuke Sato [Tue, 18 Jan 2011 13:00:57 +0000 (22:00 +0900)]
Fix possible SEGV in ibus_bus_get_global_engine.

The g_variant_get returns NULL when the IPC call times out.

BUG=none
TEST=none

Review URL: http://codereview.appspot.com/3974043

13 years agoHandle GlobalEngineChanged signals from ibus-daemon.
Yusuke Sato [Tue, 18 Jan 2011 12:51:40 +0000 (21:51 +0900)]
Handle GlobalEngineChanged signals from ibus-daemon.

BUG=http://crosbug.com/11011
TEST=manually

Review URL: http://codereview.appspot.com/4037042

13 years agoOn ChromeOS, we don't have to (and don't want to) set default preload engines.
Yusuke Sato [Tue, 18 Jan 2011 01:33:48 +0000 (10:33 +0900)]
On ChromeOS, we don't have to (and don't want to) set default preload engines.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/4054041

13 years agoSet nonzero serial number for RegistryChanged / EngineChanged signals.
Daiki Ueno [Mon, 17 Jan 2011 05:22:18 +0000 (14:22 +0900)]
Set nonzero serial number for RegistryChanged / EngineChanged signals.

libdbus expects each message serial is greater than 0.
https://code.google.com/p/ibus/issues/detail?id=1186

BUG=none
TEST=manual test described in the issue#1186

Review URL: http://codereview.appspot.com/4050041

13 years agoFix typo in the default configuration of the trigger hotkeys.
Yusuke Sato [Sun, 16 Jan 2011 02:35:09 +0000 (11:35 +0900)]
Fix typo in the default configuration of the trigger hotkeys.

According to setup/keyboardshortcut.py, "Control" seems to be correct.

BUG=none
TEST=compile ibus with --enable-memconf, start ibus-daemon, start ibus-setup, click "..." button for the "Enable or disable" hotkey, then verify that the "Control" checkbox in the pop-up dialog is checked from the beginning.

Review URL: http://codereview.appspot.com/4017042

13 years agoSet correct g-flags to proxy objects.
Yusuke Sato [Sun, 16 Jan 2011 02:34:34 +0000 (11:34 +0900)]
Set correct g-flags to proxy objects.

This change is similar to https://github.com/ibus/ibus/commit/19247aac5a348185a0e180f254ab3858c5f85703.

The flag can prevent unnecessary communications between ibus-daemon and e.g. engines like this:

$ . ~/.config/ibus/bus/*-unix-0 ; dbus-monitor --address $IBUS_ADDRESS 2>&1 | tee /tmp/ibus.log
...
method call sender=org.freedesktop.DBus -> dest=(null destination) serial=3 path=/org/freedesktop/IBus/Factory; interface=org.freedesktop.IBus.Factory; member=CreateEngine
   string "mozc-jp"
method return sender=:1.15 -> dest=org.freedesktop.DBus reply_serial=3
   object path "/org/freedesktop/IBus/Engine/1"
method call sender=org.freedesktop.DBus -> dest=(null destination) serial=4 path=/org/freedesktop/IBus/Engine/1; interface=org.freedesktop.DBus.Properties; member=GetAll
   string "org.freedesktop.IBus.Engine"
method return sender=:1.15 -> dest=org.freedesktop.DBus reply_serial=4
   array [
   ]

Calling an engine's org.freedesktop.DBus.Properties.GetAll method when the engine is created is unnecessary for ibus-daemon, while it's not harmful though.

BUG=none
TEST=verified using dbus-monitor that ibus-daemon does not call GetAll anymore.

Review URL: http://codereview.appspot.com/4036041

13 years agoFix a gcc warning seen in Chromium OS build.
Yusuke Sato [Wed, 12 Jan 2011 13:44:08 +0000 (22:44 +0900)]
Fix a gcc warning seen in Chromium OS build.

Please note that gcc's warn_unused_result check is enforced on the build environment. Anyway, I believe it's good to check the return value in this case.

BUG=none
TEST=ran emerge-x86-generic ibus.

Review URL: http://codereview.appspot.com/3904044

13 years agoRemove a gcc warning.
Yusuke Sato [Wed, 12 Jan 2011 13:43:16 +0000 (22:43 +0900)]
Remove a gcc warning.

ibusxml.c: In function 'ibus_xml_parse_file':
ibusxml.c:213: error: 'retval' may be used uninitialized in this function

BUG=none
TEST=ran make CFLAGS="-Wall -O2"

Review URL: http://codereview.appspot.com/3858044

13 years agoFix typo in ibus_bus_exit.
Yusuke Sato [Wed, 12 Jan 2011 13:42:24 +0000 (22:42 +0900)]
Fix typo in ibus_bus_exit.

BUG=none
TEST=ran make CFLAGS="-Wall -O2"

Review URL: http://codereview.appspot.com/3900045

13 years agoFix the return value of ibus_bus_register_component so it returns TRUE on success.
Yusuke Sato [Mon, 10 Jan 2011 05:25:07 +0000 (14:25 +0900)]
Fix the return value of ibus_bus_register_component so it returns TRUE on success.

Do the same for ibus_bus_set_global_engine as well. Currently it always returns TRUE regardless of the result of the method call.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/3902043

13 years agoChange the return type of ibus_bus_exit to make it compatible with ibus-1.3 API.
Yusuke Sato [Sun, 9 Jan 2011 06:12:11 +0000 (15:12 +0900)]
Change the return type of ibus_bus_exit to make it compatible with ibus-1.3 API.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/3923042

13 years agoSet correct sender and interface when sending org.freedesktop.IBus signals.
Daiki Ueno [Fri, 7 Jan 2011 01:42:44 +0000 (10:42 +0900)]
Set correct sender and interface when sending org.freedesktop.IBus signals.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3775042

13 years agoSet the "g-default-timeout" property for ibusconfig, ibusinputcontext, and ibusbus...
Yusuke Sato [Thu, 6 Jan 2011 16:38:23 +0000 (01:38 +0900)]
Set the "g-default-timeout" property for ibusconfig, ibusinputcontext, and ibusbus objects. The GDBus default timeout (25 seconds) seems to be too long for IBus.

BUG=none
TEST=manually, with IBUS_BUS_TIMEOUT=-3,-2,-1,0,1,1000,6000,abc,1abc,abc1

Review URL: http://codereview.appspot.com/3799049

13 years agoUse the G_DBUS_CALL_FLAGS_NO_AUTO_START flag just in case.
Yusuke Sato [Thu, 6 Jan 2011 03:28:54 +0000 (12:28 +0900)]
Use the G_DBUS_CALL_FLAGS_NO_AUTO_START flag just in case.

BUG=none
TEST=manually on Chromium OS.

Review URL: http://codereview.appspot.com/3774043

13 years agoDo not write empty string to "preload_engines" for safety.
Yusuke Sato [Thu, 6 Jan 2011 03:24:36 +0000 (12:24 +0900)]
Do not write empty string to "preload_engines" for safety.

Without the change, bus_ibus_impl_set_default_preload_engines() might erase an existing preload_engines config when --timeout option for ibus-daemon is too short for ibus_config_get() to success.

BUG=none
TEST=manually with 'ibus-daemon --timeout=1'

Review URL: http://codereview.appspot.com/3789046

13 years agoCall ibus_hotkey_profile_remove_hotkey_by_event in bus_ibus_impl_set_trigger before...
Yusuke Sato [Wed, 5 Jan 2011 23:44:49 +0000 (08:44 +0900)]
Call ibus_hotkey_profile_remove_hotkey_by_event in bus_ibus_impl_set_trigger before registering the fallback hotkey, just in case.

Probably it's better to call the remove function in bus_ibus_impl_set_trigger just as bus_ibus_impl_set_hotkey already does, so that a wierd error message like 'IBUS-CRITICAL **: ...: file ibushotkey.c: line 381 (ibus_hotkey_profile_add_hotkey): should not be reached' will not be shown.

The fallback hotkey could be registered twice, via bus_ibus_impl_init and _dbus_name_owner_changed_cb, if the --timeout parameter is too small to talk to the configuration daemon, for example.

BUG=none
TEST=ran ibus-daemon with --timeout=1 and verified that the IBUS-CRITICAL message above was not shown.

Review URL: http://codereview.appspot.com/3796044

13 years agoReplace g_return_if_fail with g_warning since the error message 'desc != NULL' seems...
Yusuke Sato [Wed, 5 Jan 2011 23:25:47 +0000 (08:25 +0900)]
Replace g_return_if_fail with g_warning since the error message 'desc != NULL' seems confusing.

BUG=none
TEST=manually. removed all engines using ibus-setup and ran ibus-daemon, then press a trigger hot-key.

Review URL: http://codereview.appspot.com/3786047

13 years agoFix --timeout command line option of ibus-daemon.
Yusuke Sato [Wed, 5 Jan 2011 23:22:38 +0000 (08:22 +0900)]
Fix --timeout command line option of ibus-daemon.

On 1.3.99, currently the option is just ignored and '-1' (i.e. the default timeout of gdbus which is 25 seconds in glib-2.26.1) is always used. We should fix this since the default, 25 secs, is too long for some platforms like Chromium OS.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/3784047

13 years agoSupport hotkeys that use Super/Hyper modifiers.
Yusuke Sato [Sat, 1 Jan 2011 08:34:37 +0000 (17:34 +0900)]
Support hotkeys that use Super/Hyper modifiers.

BUG=1175
TEST=checked that Super+space and Hyper+space work as intended with and without the use_sys_layout option enabled.

Review URL: http://codereview.appspot.com/3856041

13 years agoReply an error message to sender, if ibus-daemon can not forward method call message...
Peng Huang [Tue, 28 Dec 2010 23:44:16 +0000 (16:44 -0700)]
Reply an error message to sender, if ibus-daemon can not forward method call message successfully.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/3825042

13 years agoFix g_variant_get() call in DeleteSurroundingText signal handler.
Daiki Ueno [Tue, 28 Dec 2010 03:46:25 +0000 (12:46 +0900)]
Fix g_variant_get() call in DeleteSurroundingText signal handler.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3820042

13 years agoFix API compatibility issue in ibus_config_new.
Yusuke Sato [Sun, 26 Dec 2010 22:58:29 +0000 (07:58 +0900)]
Fix API compatibility issue in ibus_config_new.

On ibus-1.3, ibus_config_new returns NULL when ibus-gconf is not started yet, but on 1.4 it returns a valid, non-NULL IBusConfig object. This patch fixes the discrepancy by changing the behavior of ibus_config_new of 1.4.

If we don't return NULL when ibus-gconf does not exist, successive calls e.g. ibus_config_set_value will fail with a cryptic error message like 'IBUS-WARNING **: org.freedesktop.IBus.Config.SetValue: Cannot invoke method; proxy is for a well-known name without an owner and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag'. I believe returning NULL makes it easier to use the ibusconfig.h APIs.

Please note that this patch is particularly important for Chromium OS. Since ibus_config_new is called shortly after ibus-daemon starts on the OS, ibus_config_new is sometimes called before ibus-memconf starts actually. This change helps the glue between chrome and ibus-daemon to remain clean.

BUG=none
TEST=manually on Chromium OS

Review URL: http://codereview.appspot.com/3784043

13 years agoCreate an instance of GDBusProxy with G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag.
Yusuke Sato [Sun, 26 Dec 2010 22:57:09 +0000 (07:57 +0900)]
Create an instance of GDBusProxy with G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES flag.

Without the flag, on_name_owner_changed() in glib-2.26.x/gio/gdbusproxy.c might invoke a remote method named GetAll in org.freedesktop.DBus.Properties interface, but the method is not implemented in ibus-daemon. Since ibus-daemon ignores the method call, the caller, which is UI thread of Chrome on Chromium OS, will block for 25 seconds (i.e. the default timeout of GDBus) waiting for a reply.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/3836042

13 years agoFix Alt+Shift hotkey issue for chrome os
Peng Huang [Sun, 26 Dec 2010 05:05:13 +0000 (22:05 -0700)]
Fix Alt+Shift hotkey issue for chrome os

BUG=chromium-os:6225
TEST=manual

Review URL: http://codereview.appspot.com/3741043

13 years agoFix hot-key handling in inputcontext.c.
Yusuke Sato [Wed, 22 Dec 2010 14:03:03 +0000 (23:03 +0900)]
Fix hot-key handling in inputcontext.c.

Without the fix, some key combinations might not trigger a hot-key event.
For example, one of Chrome OS hot-keys, "press Shift, then press Alt, then release Alt", does not work without the fix.

BUG=none
TEST=manually checked using ChromeOS and IBus-1.4

Review URL: http://codereview.appspot.com/3828041

13 years agoAdd comments to ibusproxy.[ch] and related functions.
Yusuke Sato [Mon, 20 Dec 2010 16:04:49 +0000 (01:04 +0900)]
Add comments to ibusproxy.[ch] and related functions.

BUG=none
TEST=none

Review URL: http://codereview.appspot.com/3802042

13 years agoFix ibus_input_context_get_input_context() so IBus.Service.Destroy will not be called...
Yusuke Sato [Mon, 20 Dec 2010 16:04:05 +0000 (01:04 +0900)]
Fix ibus_input_context_get_input_context() so IBus.Service.Destroy will not be called when the returned object is disposed.

BUG=none
TEST=verified that calling g_object_unref(the_returned_object) does not result in the remote method call.

Review URL: http://codereview.appspot.com/3803041

13 years agoDon't call nonexistent org.freedesktop.IBus.InputContext.Destroy.
Daiki Ueno [Mon, 20 Dec 2010 09:19:04 +0000 (18:19 +0900)]
Don't call nonexistent org.freedesktop.IBus.InputContext.Destroy.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3800041

13 years agoFix typo in introspection_xml[] for InputContext.
Yusuke Sato [Mon, 20 Dec 2010 06:02:20 +0000 (15:02 +0900)]
Fix typo in introspection_xml[] for InputContext.

https://github.com/ibus/ibus/commit/ed778cd7cfc78eb39fc74167f2169b69f4d72a6b was incomplete, sorry.

BUG=none
TEST=verified that properties can be changed via input context on Chrome OS.

Review URL: http://codereview.appspot.com/3795041

13 years agoInit GError before calling g_dbus_proxy_call*().
Daiki Ueno [Wed, 15 Dec 2010 09:33:33 +0000 (18:33 +0900)]
Init GError before calling g_dbus_proxy_call*().

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3669041

13 years agoFix gtk version check for deprecated keysyms.
Daiki Ueno [Wed, 15 Dec 2010 09:32:17 +0000 (18:32 +0900)]
Fix gtk version check for deprecated keysyms.

From the git log of gtk3, they started adding _KEY from 2.91.0 not 2.90.0.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3670041

13 years agoDisconnect closed signal from GDBusConnection before creating a new connection.
Peng Huang [Wed, 15 Dec 2010 09:04:43 +0000 (17:04 +0800)]
Disconnect closed signal from GDBusConnection before creating a new connection.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3668041

13 years agoFix assertion failure in ibusbus.c.
Yusuke Sato [Wed, 15 Dec 2010 06:13:00 +0000 (15:13 +0900)]
Fix assertion failure in ibusbus.c.

The following code does not work since the underlying connection for IBus-1.4 is not a sub class of IBusObject.

        ibus_object_destroy ((IBusObject *)priv->connection);
        g_assert (priv->connection == NULL);

BUG=none
TEST=ran Chrome for Chrome OS.

Review URL: http://codereview.appspot.com/3658041

13 years agoFix type mismatch in src/ibuspanelservice.c.
Yusuke Sato [Wed, 15 Dec 2010 05:36:19 +0000 (14:36 +0900)]
Fix type mismatch in src/ibuspanelservice.c.

BUG=none
TEST=ran candidate_window for Chrome OS.

Review URL: http://codereview.appspot.com/3661041

13 years agoUse unsigned for the parameter of the PropertyActivate message.
Yusuke Sato [Wed, 15 Dec 2010 05:09:20 +0000 (14:09 +0900)]
Use unsigned for the parameter of the PropertyActivate message.

unsigned would be better since the Python binding and engine proxy use unsigned for this purpose.

BUG=none
TEST=ran Chrome for Chrome OS.

Review URL: http://codereview.appspot.com/3660041

13 years agoFix type mismatch in the PropertyActivate message.
Yusuke Sato [Wed, 15 Dec 2010 02:55:16 +0000 (11:55 +0900)]
Fix type mismatch in the PropertyActivate message.

src/ibusinputcontext.c sends the massage with "(si)" but the daemon use the massage as "(&su)". This triggers assertion failure on Chrome OS.

BUG=none
TEST=change ibus-mozc's property on Chrome OS via the IME menu.

Review URL: http://codereview.appspot.com/3636041

13 years agoFix crash in im-ibus.so
Peng Huang [Thu, 2 Dec 2010 05:12:53 +0000 (13:12 +0800)]
Fix crash in im-ibus.so

BUG=chromium-os:9868
TEST=manual

Review URL: http://codereview.appspot.com/3401041

13 years agoFocus out/in fake input context if the input window changed.
Peng Huang [Sun, 21 Nov 2010 10:26:18 +0000 (19:26 +0900)]
Focus out/in fake input context if the input window changed.

BUG=chromium-os:8855
TEST=manual

Review URL: http://codereview.appspot.com/3199042

13 years agoFocus out the fake context in im-ibus.so, when a real context gets the focus.
Peng Huang [Tue, 14 Dec 2010 02:16:32 +0000 (10:16 +0800)]
Focus out the fake context in im-ibus.so, when a real context gets the focus.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3561042

13 years agoAdd fake context back in IBusIMContext.
Peng Huang [Tue, 14 Dec 2010 02:14:45 +0000 (10:14 +0800)]
Add fake context back in IBusIMContext.

The fake context is removed by mistake in ibus-1.4. It is necessary for Chrome OS.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3574042

13 years agoFix typo and annotation.
Peng Huang [Mon, 13 Dec 2010 09:37:09 +0000 (17:37 +0800)]
Fix typo and annotation.

Fix typo in IBusEngineDesc:rank doc and GI transfer mode for
ibus_component_get_engines().

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3614041

13 years agoFix GI transfer mode annotation in ibus_bus_list_*engines() comment.
Peng Huang [Wed, 8 Dec 2010 08:37:42 +0000 (16:37 +0800)]
Fix GI transfer mode annotation in ibus_bus_list_*engines() comment.

See https://bugzilla.gnome.org/show_bug.cgi?id=635248.  Also, do not mark those
functions as "not implemented", since they are apparently implemented.

BUG=none
TEST=manual

Review URL: http://codereview.appspot.com/3274044

13 years agoAdd #include <ibuspanelservice.h> to ibus.h.
Yusuke Sato [Thu, 2 Dec 2010 15:42:45 +0000 (00:42 +0900)]
Add #include <ibuspanelservice.h> to ibus.h.

Add #include <ibuspanelservice.h> to ibus.h so an external project (e.g. Chromium OS project) could implement its own panel component in C/C++.

Review URL: http://codereview.appspot.com/3411041

13 years agoRemove unused header file, src/ibusconfigprivate.h
Yusuke Sato [Thu, 2 Dec 2010 15:41:15 +0000 (00:41 +0900)]
Remove unused header file, src/ibusconfigprivate.h

Review URL: http://codereview.appspot.com/3412041

13 years agoFix compile errors on Chromium OS.
Yusuke Sato [Wed, 1 Dec 2010 13:00:44 +0000 (22:00 +0900)]
Fix compile errors on Chromium OS.

This is for the master branch of ibus.

BUG=crosbug.com/9685
TEST=ran emerge-x86-generic ibus.

Review URL: http://codereview.appspot.com/3368041

13 years agoDo not call g_critical when ibus->config is NULL since it's not an error.
Yusuke Sato [Mon, 29 Nov 2010 03:04:27 +0000 (12:04 +0900)]
Do not call g_critical when ibus->config is NULL since it's not an error.

The change is originally for chromeos branch of ibus (http://codereview.appspot.com/3304043/) but I believe this is also good for the master branch of ibus.

BUG=none
TEST=manually

Review URL: http://codereview.appspot.com/3269043