Hi Ryo,
One of our QA Engineers found this bug, it reproduces randomly. scim
works OK, but scim-bridge doesn't.
Url for bug report:
https://bugzilla.novell.com/show_bug.cgi?id=465620 Steps to reproduce:
Make sure SCIM select option "shared instance between
applications".
Steps to reproduce:
1.Launch gedit and firefox
2.choose one input method scim-pinyin, scim-tables, or novel-pinyin, enable it.
3. focus in firefox, input some text.
4. focus in gedit, input some text.
repeat 3,4, more than three times, usually two will be enough, the input method
begin to only input English.
Disabled and re-enable input method, will re-enable the input method.
The cause of the bug:
This problems is caused by race condition.
Theoretically when switch from firefox to gedit, firefox
will send out focus out first, then gedit send focus in.
But the events are delivered by socket/pipe, sometimes
focus in comes first,and a fake focus out event is
emulated, then the real focus out event comes, the input
method get disabled.
The patch will just ignore the second focus out event as
scim-bridge already send a simulated foucs out event for
it.
The attachment is the patch.
Thanks a lot for the help from James Su on making this patch.
Best Wishes,
Peng Wu
Index: scim-bridge-0.4.15/agent/scim-bridge-agent-imcontext.cpp
===================================================================
--- scim-bridge-0.4.15.orig/agent/scim-bridge-agent-imcontext.cpp
+++ scim-bridge-0.4.15/agent/scim-bridge-agent-imcontext.cpp
@@ -146,6 +146,7 @@ class ScimBridgeAgentIMContextImpl: publ
IMEngineInstancePointer imengine;
bool enabled;
+ bool focused;
scim_bridge_preedit_mode_t preedit_mode;
bool preedit_shown;
@@ -274,7 +275,7 @@ void ScimBridgeAgentIMContext::set_on_th
ScimBridgeAgentIMContextImpl::ScimBridgeAgentIMContextImpl (ScimBridgeAgentClientListener *new_client_listener):
-client_listener (new_client_listener), imengine (NULL), enabled (false), preedit_mode (PREEDIT_ANY),
+client_listener (new_client_listener), imengine (NULL), enabled (false), focused(false) ,preedit_mode (PREEDIT_ANY),
preedit_shown (false), preedit_cursor_position (0)
{
if (free_imcontexts.empty ()) {
@@ -646,6 +647,8 @@ void ScimBridgeAgentIMContextImpl::focus
panel_listener->hide_aux_string ();
panel_listener->hide_lookup_table ();
hide_preedit ();
+
+ focused = true;
}
@@ -653,6 +656,9 @@ void ScimBridgeAgentIMContextImpl::focus
{
ScimBridgeAgentIMContext *focused_imcontext = static_cast<ScimBridgeAgentIMContext*> (get_imengine ()->get_frontend_data ());
+ if ( !focused )
+ return;
+
get_imengine ()->set_frontend_data (static_cast<ScimBridgeAgentIMContext*> (this));
hide_preedit ();
@@ -666,6 +672,8 @@ void ScimBridgeAgentIMContextImpl::focus
} else {
imengine->set_frontend_data (NULL);
}
+
+ focused = false;
}
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword_______________________________________________
Scim-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/scim-devel