Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: bus/ibusimpl.c

Issue 2255002: When the previous engine name is unknown, switch to the next engine in menu. (Closed) Base URL: ssh://git@gitrw.chromium.org//ibus.git
Patch Set: address comments Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* vim:set et sts=4: */ 1 /* vim:set et sts=4: */
2 /* ibus - The Input Bus 2 /* ibus - The Input Bus
3 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com> 3 * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
4 * Copyright (C) 2008-2010 Red Hat, Inc. 4 * Copyright (C) 2008-2010 Red Hat, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public 7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 if (!ibus->use_global_engine) { 969 if (!ibus->use_global_engine) {
970 engine_name = (gchar *) g_object_get_data (G_OBJECT (context), "previous -engine-name"); 970 engine_name = (gchar *) g_object_get_data (G_OBJECT (context), "previous -engine-name");
971 } 971 }
972 else { 972 else {
973 if (!ibus->global_previous_engine_name) { 973 if (!ibus->global_previous_engine_name) {
974 ibus->global_previous_engine_name = bus_ibus_impl_load_global_previo us_engine_name_from_config (ibus); 974 ibus->global_previous_engine_name = bus_ibus_impl_load_global_previo us_engine_name_from_config (ibus);
975 } 975 }
976 engine_name = ibus->global_previous_engine_name; 976 engine_name = ibus->global_previous_engine_name;
977 } 977 }
978 978
979 /*
980 * If the previous engine name is not found, switch to the next engine
981 * in the menu. This behavior is better than doing nothing.
982 */
983 if (!engine_name) {
984 bus_ibus_impl_context_request_next_engine_in_menu(ibus, context);
985 return;
986 }
979 _context_request_engine_cb (context, engine_name, ibus); 987 _context_request_engine_cb (context, engine_name, ibus);
980 } 988 }
981 989
982 static void 990 static void
983 _global_engine_destroy_cb (BusEngineProxy *engine, 991 _global_engine_destroy_cb (BusEngineProxy *engine,
984 BusIBusImpl *ibus) 992 BusIBusImpl *ibus)
985 { 993 {
986 if (ibus->global_engine != engine) { 994 if (ibus->global_engine != engine) {
987 return; 995 return;
988 } 996 }
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
2031 g_hash_table_unref (ibus->hotkey_to_engines_map); 2039 g_hash_table_unref (ibus->hotkey_to_engines_map);
2032 } 2040 }
2033 2041
2034 ibus->engines_hotkey_profile = ibus_hotkey_profile_new(); 2042 ibus->engines_hotkey_profile = ibus_hotkey_profile_new();
2035 ibus->hotkey_to_engines_map = 2043 ibus->hotkey_to_engines_map =
2036 g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_list_free); 2044 g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) g_list_free);
2037 2045
2038 g_list_foreach (ibus->register_engine_list, (GFunc) _add_engine_hotkey, ibus ); 2046 g_list_foreach (ibus->register_engine_list, (GFunc) _add_engine_hotkey, ibus );
2039 g_list_foreach (ibus->engine_list, (GFunc) _add_engine_hotkey, ibus); 2047 g_list_foreach (ibus->engine_list, (GFunc) _add_engine_hotkey, ibus);
2040 } 2048 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698