diff -up src/IBusChewingEngine.gob.rhbz1119963 src/IBusChewingEngine.gob --- src/IBusChewingEngine.gob.rhbz1119963 2014-12-16 18:46:26.687255281 +1000 +++ src/IBusChewingEngine.gob 2014-12-16 18:50:27.831180202 +1000 @@ -112,7 +112,7 @@ enum CHEWING_FLAG{ * @NEED_COMMIT: There's Something to commit. * @FORCE_COMMIT: The engine should commit * @IS_PASSWORD: Current input is password. - * @IS_ENGLISH: English mode + * @PROPERTIES_REGISTERED: Engine registered the properties. * * Engine status show the current states of engine, * Thus this will change quite often. @@ -128,6 +128,7 @@ enum ENGINE_STATUS{ NEED_COMMIT= 0x10, FORCE_COMMIT= 0x20, IS_PASSWORD= 0x40, + PROPERTIES_REGISTERED= 0x80, } Engine:Status; %h{ @@ -690,7 +691,8 @@ class IBus:Chewing:Engine from IBus:Engi ibus_property_set_symbol(self->chieng_prop,SELF_GET_CLASS(self)->chieng_prop_label_eng); #endif } - ibus_engine_update_property(IBUS_ENGINE(self),self->chieng_prop); + if (self->_priv->statusFlags & ENGINE_STATUS_PROPERTIES_REGISTERED) + ibus_engine_update_property(IBUS_ENGINE(self), self->chieng_prop); }else if (strcmp(prop_name,"chewing_alnumSize_prop")==0){ if (chewing_get_ShapeMode(self->context)){ /* Full-Sized Shape */ @@ -699,7 +701,8 @@ class IBus:Chewing:Engine from IBus:Engi /* Half-Sized Shape */ ibus_property_set_label(self->alnumSize_prop,SELF_GET_CLASS(self)->alnumSize_prop_label_half); } - ibus_engine_update_property(IBUS_ENGINE(self),self->alnumSize_prop); + if (self->_priv->statusFlags & ENGINE_STATUS_PROPERTIES_REGISTERED) + ibus_engine_update_property(IBUS_ENGINE(self),self->alnumSize_prop); } } @@ -715,17 +718,19 @@ class IBus:Chewing:Engine from IBus:Engi * Refresh the property list (language bar). */ public void refresh_property_list(self){ - self_refresh_property(self,"chewing_chieng_prop"); + if (!(self->_priv->statusFlags & ENGINE_STATUS_PROPERTIES_REGISTERED)) { + self_refresh_property(self,"chewing_chieng_prop"); + + self_refresh_property(self,"chewing_alnumSize_prop"); - self_refresh_property(self,"chewing_alnumSize_prop"); + self_refresh_property(self,"chewing_settings_prop"); - self_refresh_property(self,"chewing_settings_prop"); - if (self->_priv->statusFlags & (ENGINE_STATUS_ENABLED | ENGINE_STATUS_FOCUS_IN)){ ibus_engine_register_properties(IBUS_ENGINE(self),self->prop_list); IBUS_ENGINE_GET_CLASS(self)->property_show(IBUS_ENGINE(self),"chewing_chieng_prop"); IBUS_ENGINE_GET_CLASS(self)->property_show(IBUS_ENGINE(self),"chewing_alnumSize_prop"); IBUS_ENGINE_GET_CLASS(self)->property_show(IBUS_ENGINE(self),"chewing_settings_prop"); } + } /** @@ -1094,6 +1099,9 @@ class IBus:Chewing:Engine from IBus:Engi ibus_chewing_engine_clear_status_flag(self, ENGINE_STATUS_FORCE_COMMIT | ENGINE_STATUS_NEED_COMMIT); + ibus_chewing_engine_set_status_flag(self, + ENGINE_STATUS_PROPERTIES_REGISTERED); + // self_update(self); IBUS_CHEWING_LOG(4,"[I4] focus_in(): return"); } @@ -1110,6 +1118,9 @@ class IBus:Chewing:Engine from IBus:Engi * IBUS_ENGINE_PREEDIT_COMMIT */ // self_force_commit(self); +// + ibus_chewing_engine_clear_status_flag(self, ENGINE_STATUS_PROPERTIES_REGISTERED); + IBUS_CHEWING_LOG(5,"[I5] focus_out(): return"); }