summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-05-26Fix GVariant leak in IBusService::GetValueHEADmasterChristophe Fergeau1-0/+1
When handling the DBus GetValue call, ibusconfigservice.c:ibus_config_service_service_method_call() gets a non-floating GVariant reference through IBusConfigService::get_value() but never unrefs it. Running ibus-dconf in valgrind and then running tests/ibus-config shows this leak: =28085== 232 (80 direct, 152 indirect) bytes in 2 blocks are definitely lost in loss record 2,025 of 2,121 ==28085== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==28085== by 0x56EDDF2: g_malloc (gmem.c:97) ==28085== by 0x570691C: g_slice_alloc (gslice.c:1007) ==28085== by 0x572E6D9: g_variant_get_child_value (gvariant-core.c:1009) ==28085== by 0x57261C0: g_variant_get_variant (gvariant.c:715) ==28085== by 0x4C1A732: gvdb_table_value_from_item (gvdb-reader.c:578) ==28085== by 0x4C1A7A1: gvdb_table_get_value (gvdb-reader.c:610) ==28085== by 0x4C1589C: dconf_engine_read (dconf-engine.c:528) ==28085== by 0x4C14A79: dconf_client_read (dconf-client.c:242) ==28085== by 0x40286F: ibus_config_dconf_get_value (config.c:378) ==28085== by 0x4E44F29: ibus_config_service_service_method_call (ibusconfigservice.c:194) ==28085== by 0x4E33249: ibus_service_service_method_call_cb (ibusservice.c:395)
2014-05-26Fix GVariant leak in IBusService::SetValueChristophe Fergeau1-0/+1
When handling the DBus SetValue call, ibusconfigservice.c:ibus_config_service_service_method_call() gets a GVariant through g_variant_get("(&s&sv)") GVariant documentation says that: « Upon encountering a 'v', g_variant_get() takes a pointer to a (GVariant *) (ie: (GVariant **) ). It is set to a new reference to a GVariant instance containing the contents of the variant value. It is appropriate to free this reference using g_variant_unref(). » so we need to unreference it when we are done with it. Running ibus-dconf in valgrind and then running tests/ibus-config shows this leak: ==28085== 3,934 (1,520 direct, 2,414 indirect) bytes in 38 blocks are definitely lost in loss record 2,112 of 2,121 ==28085== at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==28085== by 0x56EDDF2: g_malloc (gmem.c:97) ==28085== by 0x570691C: g_slice_alloc (gslice.c:1007) ==28085== by 0x572E6D9: g_variant_get_child_value (gvariant-core.c:1009) ==28085== by 0x57261C0: g_variant_get_variant (gvariant.c:715) ==28085== by 0x572BD03: g_variant_valist_get_nnp (gvariant.c:4794) ==28085== by 0x572C3F1: g_variant_valist_get_leaf (gvariant.c:4911) ==28085== by 0x572CAD4: g_variant_valist_get (gvariant.c:5092) ==28085== by 0x572CC59: g_variant_valist_get (gvariant.c:5127) ==28085== by 0x572D079: g_variant_get_va (gvariant.c:5354) ==28085== by 0x572CF9B: g_variant_get (gvariant.c:5301) ==28085== by 0x4E44E5B: ibus_config_service_service_method_call (ibusconfigservice.c:173)
2014-05-26Return non-floating ref from IBusConfigGConf::get_valueChristophe Fergeau1-1/+1
Both IBusConfigDConf::get_value and IBusConfigMemconf::get_value return a non-floating reference, so we need to be consistent in the gconf backend and also return a non-floating reference.
2014-05-26dconf: Fix GVariant refcounting in watch_func()Christophe Fergeau1-0/+1
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)
2014-05-26tests/ibus-engine-switch: Don't try to remove non-existing GSourceChristophe Fergeau1-6/+4
ibus-engine-switch schedules an idle doing an engine switch, and also schedules a timeout after 1 microsecond which exits the main loop. Both of these callbacks will return FALSE, which detaches the associated GSource from the mainloop and destroys it. As the only way to exit the mainloop is when the timeout callback runs, we should not try to run g_source_remove(timeout_id) as it will already be gone, and this causes a warning. This commit reorders a bit to make the ordering between the idle and timeout more obvious, and it gets rid of the calls to g_source_remove() as they are needed.
2014-05-26tests/ibus-config Fix timeout_id handlingChristophe Fergeau1-5/+10
tests/ibus-config queues a timeout whose callback calls g_main_loop_quit() before returning FALSE. After exiting the mainloop, g_source_remove(timeout_id) is called, but if the mainloop was exited through the timeout callback, the source will already have been removed. This commit makes sure we only try to call g_source_remove() on that timeout if we did not exit the mainloop through the timeout callback.
2014-05-26Fix GVariantBuilder leaksChristophe Fergeau6-10/+17
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)
2014-05-26tests/ibus-config: Fix typo in function nameChristophe Fergeau1-2/+2
"success" was misspelt "sucess"
2014-05-23Fix leak in ibus-engine-switch testChristophe Fergeau1-0/+1
2014-05-23Fix GDBusNodeInfo leak in ibus_service_class_add_interfacesChristophe Fergeau1-1/+1
A call to g_dbus_node_info_unref was in place but commented out.
2014-05-23Fix gtk-doc 'transfer' annotationsChristophe Fergeau5-17/+17
Some functions were documented as (transfer none) instead of (transfer full) even though the caller of the function owns the returned object. This will cause some leaks when using gobject-introspection.
2014-05-23Fix GObject leaks in ibus_property_deserialize()Christophe Fergeau1-0/+12
2014-05-23Fix g_dbus_proxy_get_name_owner() leaksChristophe Fergeau1-2/+8
2014-05-23Fix string leaks in deserialize vfuncsChristophe Fergeau6-25/+41
When an object contains char * properties, its deserialize function will overwrite these string values without freeing them first. They are not necessarily NULL as they can have (default) values set upon construction, so they need to be g_free'd before being overwritten. This commit introduces a ibus_g_variant_get_child_string() to do this and set the string value.
2014-05-23Fix GVariant leaksChristophe Fergeau1-0/+2
2014-05-23Fix small typo in gtk-doc API docChristophe Fergeau1-1/+1
2014-05-23build-sys: Fix 'privite' typo in Makefile.amChristophe Fergeau1-2/+2
2014-05-09Let ibus-ui-gtk3 not to show zero-lenght preedit text.fujiwarat1-2/+9
preedit text is shown by ibus-ui-gtk3 on X11 applications and do not have to show it likes GTK+ when the lenght is zero. BUG=http://code.google.com/p/ibus/issues/detail?id=1709 TEST=ibus-ui-gtk3 with ibus-pinyin and x11 applications Review URL: https://codereview.appspot.com/93150043
2014-05-08Delete Korean keymap.Ryu Changwoo1-12/+0
BUG=http://code.google.com/p/ibus/issues/detail?id=1708 Review URL: https://codereview.appspot.com/92090043 Patch from Ryu Changwoo <ryu.changwoo@gmail.com>.
2014-05-08Add the nodeadkeys variant of the German keyboard layout.Eike Hein1-0/+12
BUG=http://code.google.com/p/ibus/issues/detail?id=1710 Review URL: https://codereview.appspot.com/96040043 Patch from Eike Hein <hein@kde.org>.
2014-05-02Set max-width-chars property in ibus-setup wrapped GtkLabel.fujiwarat1-0/+1
If GtkWindow has 'resizable' property = FALSE, the wrap in GtkLabel is not done automatically and need to set 'max-width-chars' property. TEST=ibus-setup Review URL: https://codereview.appspot.com/92940043
2014-04-30Release 1.5.7fujiwarat1-1/+1
Review URL: https://codereview.appspot.com/96800043
2014-04-30Update translation zh_CN.pofujiwarat1-67/+86
Review URL: https://codereview.appspot.com/96740044
2014-04-28Do not move property panel with focus-in in case panel is always shown.fujiwarat1-11/+17
Review URL: https://codereview.appspot.com/98770043
2014-04-24Do not show property panel by default.fujiwarat2-2/+2
Property panel sometimes hides text entry box on firefox in case the mode is auto-hide because firefox does not provide the right cursor locations and firefox does not update cursor locales when preedit is updated so property panel hides text entry box for a while and auto-hide is not useful with firefox and thunderbird. TEST=gsettings reset org.freedesktop.ibus.panel show Review URL: https://codereview.appspot.com/90480043
2014-04-18Change deprecated GtkHButtonBox to GtkButtonBox in ibus-setup.fujiwarat1-2/+4
Review URL: https://codereview.appspot.com/88850043
2014-04-17Fix leak in ibus_get_local_machine_id()Christophe Fergeau1-1/+3
If /var/lib/dbus/machine-id does not exist but /etc/machine-id exists, 'error' will be set but will never be freed. BUG=http://code.google.com/p/ibus/issues/detail?id=1701 Review URL: https://codereview.appspot.com/88770043 Patch from Christophe Fergeau <cfergeau@redhat.com>.
2014-04-07Keep track of content-type change after focus-inDaiki Ueno3-0/+38
This is an amendment to 6ca5ddb3. As content-type (input-purpose and hints) can change after focus-in, we should monitor the changes. BUG= R=takao.fujiwara1@gmail.com Review URL: https://codereview.appspot.com/83920043
2014-04-03Send panel input purpose.fujiwarat6-68/+199
gnome-shell gets input purpose so that disables IME with password mode. Review URL: https://codereview.appspot.com/81770044
2014-03-18Update supported vala version to 0.20.fujiwarat1-1/+1
Review URL: https://codereview.appspot.com/76830043
2014-03-18Add Czech (qwerty) keymap.fujiwarat1-0/+12
BUG=rhbz#1074879 Review URL: https://codereview.appspot.com/74520044
2014-03-07Release 1.5.6fujiwarat1-1/+1
Review URL: https://codereview.appspot.com/68530043
2014-03-07Fix deprecated GtkHBox in setup.uifujiwarat1-1/+2
Review URL: https://codereview.appspot.com/72000043
2014-03-06Update translations.fujiwarat4-231/+307
Update po/ja.po po/nl.po po/pl.po po/uk.po Review URL: https://codereview.appspot.com/69920043
2014-03-06Fix python comment in escape sequence.fujiwarat1-3/+4
Review URL: https://codereview.appspot.com/69840043
2014-02-28Add contextual information on translatable strings.Nilamdyuti Goswami2-2/+3
Source String Contextualization Group (SSCG) is a Fedora SIG group initiated to provide meaningful descriptions of the source strings for translators to ensure the correctness and quality of the translations. https://fedoraproject.org/wiki/SSCG BUG=rhbz#1069594 Review URL: https://codereview.appspot.com/69010043 Patch from Nilamdyuti Goswami <ngoswami@redhat.com>.
2014-02-25Use XKB layout string instead of ibus-keyboard icon on panel.fujiwarat4-28/+167
Review URL: https://codereview.appspot.com/66330043
2014-02-21Fix a build error of Gdk.EventKey with vala 0.23.2fujiwarat1-5/+17
Review URL: https://codereview.appspot.com/66480044
2014-02-21Update french translationJulien Humbert1-32/+87
Review URL: https://codereview.appspot.com/66450044 Patch from Julien Humbert <julroy67@gmail.com>.
2014-02-18Update translations.fujiwarat45-5120/+10721
Merged GTK+ translations. Review URL: https://codereview.appspot.com/50490045
2014-02-18Fix deprecated GtkStock in ibus-setupfujiwarat3-19/+28
Review URL: https://codereview.appspot.com/65300043
2014-02-17Fix deprecated GtkHBox, GtkVBox and GtkStock since GTK+ 3.10.fujiwarat8-72/+70
Review URL: https://codereview.appspot.com/63750043
2014-02-12Do not let property panel follow cursor when it's always shown.fujiwarat5-4/+126
Review URL: https://codereview.appspot.com/60560043
2014-02-10Fix to show Property Panel when the mode is auto hide.fujiwarat1-4/+21
Property panel sometimes is not shown when the mode is auto hide and focus is changed between existent windows. It's a timing issue of PropertyPanel.set_properties(). Review URL: https://codereview.appspot.com/54300049
2014-02-04Fix "RING ABOVE" key in the Finnish compose file.fujiwarat1-23/+25
Recently fi_FI compose table was updated in xorg/lib/libX11. http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=20fdccd8 http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=aacf95da BUG=rhbz#1060180 Review URL: https://codereview.appspot.com/59540043
2014-02-03Install pygtk2 libraries to python2 site-packages.fujiwarat4-14/+38
Review URL: https://codereview.appspot.com/58930044
2014-02-03Disable AC_MSG_ERROR if gsettings-schema-convert is not found.fujiwarat2-4/+1
Reverted 729b0aa1febccbba97286f2aceb9044d907f9ffe data/dconf/org.freedesktop.ibus.gschema.xml.in is included in tarball so gsettings-schema-convert is not required. BUG=http://code.google.com/p/ibus/issues/detail?id=1650 Review URL: https://codereview.appspot.com/58870044
2014-01-27Install IBus.py in python2 gi.override.fujiwarat2-3/+15
Review URL: https://codereview.appspot.com/56510043
2014-01-24Enable python3 ibus-setup.fujiwarat5-28/+49
The default uses 'python' and if the path of python 3 is 'python3', ./configure --with-python=python3 Review URL: https://codereview.appspot.com/54930043
2014-01-23Use LT_INIT instead of AM_PROG_LIBTOOLfujiwarat1-1/+1
BUG=http://www.gnu.org/software/libtool/manual/html_node/LT_005fINIT.html Review URL: https://codereview.appspot.com/55480044