DescriptionFix 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
Patch Set 1 : review #
Total comments: 2
Patch Set 2 : review fix #MessagesTotal messages: 4
|