- dconf/config.c: Replaced dconf_client_write_fast() with
dconf_client_write_sync() because
dconf_client_write_fast() does not syn the data when
ibus_config_get_values() is called immediately after
ibus_config_set_value() is called.
- ibus-compose-locales.in returns the return value of ibus-compose
- ibus-compose: Set $NO_AT_BRIDGE to suppress a AT_SPI warning
and call g_log_set_always_fatal() because GtkIMContextSimple
does not support multiple compose outputs yet and the API can
suppress a warning.
- ibus-config: Delete async watch testings which causes several errors
with gnome-shell testing and the testing is now deprecated and
GSettings is recommended.
- ibus-desktop-testing-runner.in: Support --output=log:stdout to
cat the log to stdout and Use dbus-launch --exit-with-session instead of
--sh-syntax and count PASS of test cases instead of PASS of
gnome-desktop-testing and always run ibus exit and kill
gnome-shell-calendar-server
- ibus-engine-switch.c: Set xkb🇯🇵:jpn if gnome-shell sets xkb🇺🇸:eng
- ibus-inputcontext.c: Use ibus_bus_get_global_engine() instead of
ibus_bus_list_active_engines() since ibus_bus_list_active_engines()
does not work with gnome-shell and the API is now deprecated.
- ibus-keypress.c: Set $NO_AT_BRIDGE to suppress a AT_SPI warning
gsettings-schema-convert has not worked with python3 since GConf
has been deprecated since 2011 so we cannot disable python2
in canse GConf is enabled.
I don't wish to maintain both ibus.schemas.in and
org.freedesktop.ibus.gschema.xml.in and now decide to delete
whole the GConf builds.
gsettings is now stable and can be used instead.
ibus-dconf will be deperecated in the near future.
BUG=https://bugzilla.gnome.org/show_bug.cgi?id=759334
IBusConfigDConf::watch_func() is roughly doing:
GVariant *variant = dconf_client_read(...)
if (variant == NULL) {
variant = g_variant_new(...);
}
ibus_config_service_value_changed(..., variant);
g_variant_unref(variant);
The problem with that is that the GVariant returned by
dconf_client_read() is non-floating while the one returned by
g_variant_new() is floating.
Since ibus_config_service_value_changed() will take ownership of
floating references, we should not unref 'variant' if it was created
through g_variant_new(), but we must call it when 'variant' is created
through dconf_client_read() or we will leak memory.
This commit fixes that by making sure we sink the reference we got
through g_variant_new().
This was sometimes causing crashes of ibus-dconf when repeatedly running
tests/ibus-config:
(ibus-dconf:24679): GLib-CRITICAL **: g_variant_unref: assertion
'value->ref_count > 0' failed
==24679== Invalid read of size 4
==24679== at 0x572E140: g_variant_unref (gvariant-core.c:625)
==24679== by 0x572DBB3: g_variant_release_children (gvariant-core.c:257)
==24679== by 0x572E202: g_variant_unref (gvariant-core.c:640)
==24679== by 0x572DBB3: g_variant_release_children (gvariant-core.c:257)
==24679== by 0x572E202: g_variant_unref (gvariant-core.c:640)
==24679== by 0x518CFDE: g_dbus_message_finalize (gdbusmessage.c:534)
==24679== by 0x5459628: g_object_unref (gobject.c:3112)
==24679== by 0x519C911: message_to_write_data_free (gdbusprivate.c:898)
==24679== by 0x519D687: write_message_cb (gdbusprivate.c:1353)
==24679== by 0x510F7F2: g_simple_async_result_complete (gsimpleasyncresult.c:763)
==24679== by 0x519CEF2: write_message_continue_writing (gdbusprivate.c:1077)
==24679== by 0x519D040: write_message_async (gdbusprivate.c:1131)
==24679== Address 0x5d8c9c4 is 36 bytes inside a block of size 40 free'd
==24679== at 0x4A07577: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==24679== by 0x56EDF6B: g_free (gmem.c:190)
==24679== by 0x5706B53: g_slice_free1 (gslice.c:1112)
==24679== by 0x572E229: g_variant_unref (gvariant-core.c:643)
==24679== by 0x40240F: _watch_func (config.c:232)
==24679== by 0x3DEA605D8B: ffi_call_unix64 (in /usr/lib64/libffi.so.6.0.1)
==24679== by 0x3DEA6056BB: ffi_call (in /usr/lib64/libffi.so.6.0.1)
==24679== by 0x544EE88: g_cclosure_marshal_generic_va (gclosure.c:1541)
==24679== by 0x544D396: _g_closure_invoke_va (gclosure.c:831)
==24679== by 0x5468808: g_signal_emit_valist (gsignal.c:3215)
==24679== by 0x54699DF: g_signal_emit (gsignal.c:3363)
==24679== by 0x4C1478D: dconf_client_dispatch_change_signal (dconf-client.c:150)
BUG=http://code.google.com/p/ibus/issues/detail?id=1712
Review URL: https://codereview.appspot.com/107800044
Patch from Christophe Fergeau <cfergeau@redhat.com>.
When using g_variant_builder_new(), we must call
g_variant_builder_unref() to free it:
"You should call g_variant_builder_unref() on the return value when it
is no longer needed. The memory will not be automatically freed by any
other call.
In most cases it is easier to place a GVariantBuilder directly on the
stack of the calling function and initialise it with
g_variant_builder_init()."
One of these leaks showed up in valgrind as:
==20702== 16,416 bytes in 114 blocks are definitely lost in loss record 2,114 of 2,115
==20702== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==20702== by 0x56EDDF2: g_malloc (gmem.c:97)
==20702== by 0x570691C: g_slice_alloc (gslice.c:1007)
==20702== by 0x5729743: g_variant_builder_new (gvariant.c:3169)
==20702== by 0x40297B: ibus_config_dconf_get_values (config.c:413)
==20702== by 0x4E44FF2: ibus_config_service_service_method_call (ibusconfigservice.c:214)
==20702== by 0x4E33249: ibus_service_service_method_call_cb (ibusservice.c:395)
==20702== by 0x51880D8: call_in_idle_cb (gdbusconnection.c:4875)
==20702== by 0x56E81D7: g_idle_dispatch (gmain.c:5319)
==20702== by 0x56E58F1: g_main_dispatch (gmain.c:3064)
==20702== by 0x56E6667: g_main_context_dispatch (gmain.c:3663)
==20702== by 0x56E6859: g_main_context_iterate (gmain.c:3734)
BUG=http://code.google.com/p/ibus/issues/detail?id=1712
Review URL: https://codereview.appspot.com/104850044
Patch from Christophe Fergeau <cfergeau@redhat.com>.
- there are missing g_error_free
- some code assume error != NULL when setting *error
- src/tests/ibus-config.c has unconditional "unset" but it checks the return value
BUG=none
Review URL: https://codereview.appspot.com/6449103