1 diff -ruN ibus-ibus-533dfc2/bus/ibusimpl.c ibus-ibus-23abee8/bus/ibusimpl.c
2 --- ibus-ibus-533dfc2/bus/ibusimpl.c 2011-09-24 00:11:24.000000000 +0900
3 +++ ibus-ibus-23abee8/bus/ibusimpl.c 2011-11-21 11:06:21.000000000 +0900
4 @@ -1044,18 +1044,19 @@
8 - * bus_ibus_impl_context_request_next_engine_in_menu:
9 + * bus_ibus_impl_context_request_rotate_engine_in_menu:
11 - * Process the "next_engine_in_menu" hotkey.
12 + * Process the "next_engine_in_menu" or "previous_engine" hotkey.
15 -bus_ibus_impl_context_request_next_engine_in_menu (BusIBusImpl *ibus,
16 - BusInputContext *context)
17 +bus_ibus_impl_context_request_rotate_engine_in_menu (BusIBusImpl *ibus,
18 + BusInputContext *context,
21 BusEngineProxy *engine;
23 IBusEngineDesc *next_desc = NULL;
27 engine = bus_input_context_get_engine (context);
29 @@ -1071,12 +1072,45 @@
31 p = g_list_find (ibus->register_engine_list, desc);
41 + /* Rotate register_engine_list and engine_list. */
42 + if (p == NULL && g_list_find (ibus->register_engine_list, desc) != NULL) {
44 + p = ibus->engine_list;
46 + p = g_list_last (ibus->engine_list);
51 p = g_list_find (ibus->engine_list, desc);
62 + /* Rerotate register_engine_list and engine_list. */
63 + if (p == NULL && g_list_find (ibus->engine_list, desc) != NULL) {
65 + p = ibus->register_engine_list;
67 + p = ibus->engine_list;
70 + p = g_list_last (ibus->register_engine_list);
72 + p = g_list_last (ibus->engine_list);
77 @@ -1126,12 +1160,9 @@
82 - * If the previous engine name is not found, switch to the next engine
83 - * in the menu. This behavior is better than doing nothing.
86 - bus_ibus_impl_context_request_next_engine_in_menu (ibus, context);
87 + bus_ibus_impl_context_request_rotate_engine_in_menu (ibus, context,
92 @@ -2066,25 +2097,26 @@
94 bus_input_context_enable (context);
96 - return (enabled != bus_input_context_is_enabled (context));
99 if (event == enable_unconditional) {
100 gboolean enabled = bus_input_context_is_enabled (context);
102 bus_input_context_enable (context);
104 - return bus_input_context_is_enabled (context);
107 if (event == disable_unconditional) {
108 gboolean enabled = bus_input_context_is_enabled (context);
110 bus_input_context_disable (context);
112 - return !bus_input_context_is_enabled (context);
116 if (bus_input_context_is_enabled (context)) {
117 - bus_ibus_impl_context_request_next_engine_in_menu (ibus, context);
118 + bus_ibus_impl_context_request_rotate_engine_in_menu (ibus, context,
122 bus_input_context_enable (context);
123 diff -ruN ibus-ibus-533dfc2/client/gtk2/ibusimcontext.c ibus-ibus-23abee8/client/gtk2/ibusimcontext.c
124 --- ibus-ibus-533dfc2/client/gtk2/ibusimcontext.c 2011-09-24 00:11:24.000000000 +0900
125 +++ ibus-ibus-23abee8/client/gtk2/ibusimcontext.c 2011-11-21 11:06:21.000000000 +0900
127 if (ibusimcontext->has_focus)
130 + /* don't set focus on password entry */
131 + if (ibusimcontext->client_window != NULL) {
134 + gdk_window_get_user_data (ibusimcontext->client_window,
135 + (gpointer *)&widget);
137 + if (GTK_IS_ENTRY (widget) &&
138 + !gtk_entry_get_visibility (GTK_ENTRY (widget))) {
143 if (_focus_im_context != NULL) {
144 g_assert (_focus_im_context != context);
145 gtk_im_context_focus_out (_focus_im_context);
146 diff -ruN ibus-ibus-533dfc2/client/gtk3/ibusimcontext.c ibus-ibus-23abee8/client/gtk3/ibusimcontext.c
147 --- ibus-ibus-533dfc2/client/gtk3/ibusimcontext.c 2011-09-24 00:11:24.000000000 +0900
148 +++ ibus-ibus-23abee8/client/gtk3/ibusimcontext.c 2011-11-21 11:06:21.000000000 +0900
150 if (ibusimcontext->has_focus)
153 + /* don't set focus on password entry */
154 + if (ibusimcontext->client_window != NULL) {
157 + gdk_window_get_user_data (ibusimcontext->client_window,
158 + (gpointer *)&widget);
160 + if (GTK_IS_ENTRY (widget) &&
161 + !gtk_entry_get_visibility (GTK_ENTRY (widget))) {
166 if (_focus_im_context != NULL) {
167 g_assert (_focus_im_context != context);
168 gtk_im_context_focus_out (_focus_im_context);
169 diff -ruN ibus-ibus-533dfc2/client/x11/main.c ibus-ibus-23abee8/client/x11/main.c
170 --- ibus-ibus-533dfc2/client/x11/main.c 2011-09-24 00:11:24.000000000 +0900
171 +++ ibus-ibus-23abee8/client/x11/main.c 2011-11-21 11:06:21.000000000 +0900
174 static IBusBus *_bus = NULL;
176 +static gboolean _use_sync_mode = FALSE;
179 _xim_preedit_start (XIMS xims, const X11IC *x11ic)
186 +_process_key_event_done (GObject *object,
188 + gpointer user_data)
190 + IBusInputContext *context = (IBusInputContext *)object;
191 + IMForwardEventStruct *pfe = (IMForwardEventStruct*) user_data;
193 + GError *error = NULL;
194 + gboolean retval = ibus_input_context_process_key_event_async_finish (
199 + if (error != NULL) {
200 + g_warning ("Process Key Event failed: %s.", error->message);
201 + g_error_free (error);
204 + if (retval == FALSE) {
205 + IMForwardEvent (_xims, (XPointer) pfe);
207 + g_slice_free (IMForwardEventStruct, pfe);
211 xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
213 @@ -469,30 +496,57 @@
214 if (event.type == GDK_KEY_RELEASE) {
215 event.state |= IBUS_RELEASE_MASK;
217 - retval = ibus_input_context_process_key_event (x11ic->context,
219 - event.hardware_keycode - 8,
222 - if (! x11ic->has_preedit_area) {
223 - _xim_set_cursor_location (x11ic);
225 + if (_use_sync_mode) {
226 + retval = ibus_input_context_process_key_event (
229 + event.hardware_keycode - 8,
232 + if (! x11ic->has_preedit_area) {
233 + _xim_set_cursor_location (x11ic);
240 - IMForwardEventStruct fe;
241 - memset (&fe, 0, sizeof (fe));
242 + IMForwardEventStruct fe;
243 + memset (&fe, 0, sizeof (fe));
245 - fe.major_code = XIM_FORWARD_EVENT;
246 - fe.icid = x11ic->icid;
247 - fe.connect_id = x11ic->connect_id;
249 - fe.serial_number = 0L;
250 - fe.event = call_data->event;
251 + fe.major_code = XIM_FORWARD_EVENT;
252 + fe.icid = x11ic->icid;
253 + fe.connect_id = x11ic->connect_id;
255 + fe.serial_number = 0L;
256 + fe.event = call_data->event;
258 - IMForwardEvent (_xims, (XPointer) &fe);
259 + IMForwardEvent (_xims, (XPointer) &fe);
265 + IMForwardEventStruct *pfe;
267 + pfe = g_slice_new0 (IMForwardEventStruct);
268 + pfe->major_code = XIM_FORWARD_EVENT;
269 + pfe->icid = x11ic->icid;
270 + pfe->connect_id = x11ic->connect_id;
272 + pfe->serial_number = 0L;
273 + pfe->event = call_data->event;
275 + ibus_input_context_process_key_event_async (
278 + event.hardware_keycode - 8,
282 + _process_key_event_done,
291 _xim_preedit_end (_xims, x11ic);
295 +_get_boolean_env(const gchar *name,
298 + const gchar *value = g_getenv (name);
303 + if (g_strcmp0 (value, "") == 0 ||
304 + g_strcmp0 (value, "0") == 0 ||
305 + g_strcmp0 (value, "false") == 0 ||
306 + g_strcmp0 (value, "False") == 0 ||
307 + g_strcmp0 (value, "FALSE") == 0)
318 g_signal_connect (_bus, "disconnected",
319 G_CALLBACK (_bus_disconnected_cb), NULL);
321 + _use_sync_mode = _get_boolean_env ("IBUS_ENABLE_SYNC_MODE", FALSE);
325 diff -ruN ibus-ibus-533dfc2/ibus/_config.py.in ibus-ibus-23abee8/ibus/_config.py.in
326 --- ibus-ibus-533dfc2/ibus/_config.py.in 2011-09-24 00:11:24.000000000 +0900
327 +++ ibus-ibus-23abee8/ibus/_config.py.in 2011-11-21 11:06:21.000000000 +0900
330 def get_ICON_KEYBOARD():
332 - theme = gtk.icon_theme_get_default()
333 icon = '@IBUS_ICON_KEYBOARD@'
334 + fallback_icon = 'ibus-keyboard'
335 + settings = gtk.settings_get_default()
336 + if settings.get_property('gtk-icon-theme-name') != 'gnome':
337 + return fallback_icon
338 + theme = gtk.icon_theme_get_default()
339 if not theme.lookup_icon(icon, 18, 0):
340 - icon = 'ibus-keyboard'
341 + return fallback_icon
344 ISOCODES_PREFIX='@ISOCODES_PREFIX@'
345 diff -ruN ibus-ibus-533dfc2/src/ibus.h ibus-ibus-23abee8/src/ibus.h
346 --- ibus-ibus-533dfc2/src/ibus.h 2011-09-24 00:11:24.000000000 +0900
347 +++ ibus-ibus-23abee8/src/ibus.h 2011-11-21 11:06:21.000000000 +0900
349 #include <ibusconfig.h>
350 #include <ibusconfigservice.h>
351 #include <ibuspanelservice.h>
352 +#include <ibusutil.h>
354 #undef __IBUS_H_INSIDE__
356 diff -ruN ibus-ibus-533dfc2/ui/gtk/main.py ibus-ibus-23abee8/ui/gtk/main.py
357 --- ibus-ibus-533dfc2/ui/gtk/main.py 2011-09-24 00:11:24.000000000 +0900
358 +++ ibus-ibus-23abee8/ui/gtk/main.py 2011-11-21 11:06:21.000000000 +0900
362 def launch_panel(replace):
363 + settings = gtk.settings_get_default()
364 + if settings.get_property('gtk-fallback-icon-theme') == None:
365 + settings.set_property('gtk-fallback-icon-theme', 'gnome')
366 # gtk.settings_get_default().props.gtk_theme_name = "/home/phuang/.themes/aud-Default/gtk-2.0/gtkrc"
367 # gtk.rc_parse("./themes/default/gtkrc")
368 UIApplication(replace).run()
369 diff -ruN ibus-ibus-533dfc2/ui/gtk/panel.py ibus-ibus-23abee8/ui/gtk/panel.py
370 --- ibus-ibus-533dfc2/ui/gtk/panel.py 2011-09-24 00:11:24.000000000 +0900
371 +++ ibus-ibus-23abee8/ui/gtk/panel.py 2011-11-21 11:06:21.000000000 +0900
374 item = gtk.ImageMenuItem(_("No input window"))
375 size = gtk.icon_size_lookup(gtk.ICON_SIZE_MENU)
376 - item.set_image(_icon.IconWidget("gtk-info", size[0]))
377 + item.set_image(_icon.IconWidget("gtk-dialog-info", size[0]))
381 diff -ruN ibus-ibus-533dfc2/ui/gtk/toolitem.py ibus-ibus-23abee8/ui/gtk/toolitem.py
382 --- ibus-ibus-533dfc2/ui/gtk/toolitem.py 2011-09-24 00:11:24.000000000 +0900
383 +++ ibus-ibus-23abee8/ui/gtk/toolitem.py 2011-11-21 11:06:21.000000000 +0900
385 self.set_icon_name(self._prop.icon)
387 if self._prop.visible:
388 - self.set_no_show_all(False)
392 - self.set_no_show_all(True)
396 def do_clicked(self):
397 self.emit("property-activate", self._prop.key, self._prop.state)
399 self.set_active(self._prop.state == ibus.PROP_STATE_CHECKED)
400 self.set_sensitive(self._prop.sensitive)
401 if self._prop.visible:
402 - self.set_no_show_all(False)
406 - self.set_no_show_all(True)
410 def do_toggled(self):
411 # Do not send property-activate to engine in case the event is