/// <summary> /// Create an input context and setup callback handlers. /// </summary> public void CreateInputContext() { System.Diagnostics.Debug.Assert(!m_contextCreated); if (m_ibus == null) { // This seems to be needed for tests on TeamCity. // It also seems that it shouldn't be necessary to run IBus to use Linux keyboarding! return; } // A previous version of this code that seems to have worked on Saucy had the following // comment: "For IBus 1.5, we must use the current InputContext because there is no // way to enable one we create ourselves. (InputContext.Enable() has turned // into a no-op.) For IBus 1.4, we must create one ourselves because // m_ibus.CurrentInputContext() throws an exception." // However as of 2015-08-11 this no longer seems to be true: when we use the existing // input context then typing with an IPA KMFL keyboard doesn't work in the // SIL.Windows.Forms.TestApp on Trusty with unity desktop although the keyboard // indicator correctly shows the IPA keyboard. I don't know what changed or why it is // suddenly behaving differently. // // if (KeyboardController.CombinedKeyboardHandling) // { // var path = m_ibus.CurrentInputContext(); // m_inputContext = new InputContext(m_connection, path); // } // else m_inputContext = m_ibus.CreateInputContext("IbusCommunicator"); AttachContextMethods(m_inputContext); m_contextCreated = true; }
/// <summary> /// Create an input context and setup callback handlers. This method should be /// called only once, and then after KeyboardController.CombinedKeyboardHandling /// has been set properly. /// </summary> /// <remarks> /// For IBus 1.5, we must use the current InputContext because there is no /// way to enable one we create ourselves. (InputContext.Enable() has turned /// into a no-op.) For IBus 1.4, we must create one ourselves because /// m_ibus.CurrentInputContext() throws an exception. /// </remarks> public void CreateInputContext() { System.Diagnostics.Debug.Assert(!m_contextCreated); if (m_ibus == null) { // This seems to be needed for tests on TeamCity. // It also seems that it shouldn't be necessary to run IBus to use Linux keyboarding! return; } if (KeyboardController.CombinedKeyboardHandling) { var path = m_ibus.CurrentInputContext(); m_inputContext = new InputContext(m_connection, path); } else { m_inputContext = m_ibus.CreateInputContext("IbusCommunicator"); } AttachContextMethods(m_inputContext); m_contextCreated = true; }