[uim-commit] r1367 - branches/0.4/xim
ekato at freedesktop.org
ekato at freedesktop.org
Wed Aug 31 09:54:19 PDT 2005
Author: ekato
Date: 2005-08-31 09:54:16 -0700 (Wed, 31 Aug 2005)
New Revision: 1367
Modified:
branches/0.4/xim/ximic.cpp
branches/0.4/xim/ximserver.cpp
branches/0.4/xim/ximserver.h
Log:
* xim/ : Port changes in r1366 from trunk.
Modified: branches/0.4/xim/ximic.cpp
===================================================================
--- branches/0.4/xim/ximic.cpp 2005-08-31 16:38:28 UTC (rev 1366)
+++ branches/0.4/xim/ximic.cpp 2005-08-31 16:54:16 UTC (rev 1367)
@@ -407,6 +407,9 @@
}
}
+// Note that the sequence of XIM_SET_IC_FOCUS and XIM_UNSET_FOCUS
+// events is not consistent. Be careful about hiding caret state and
+// candidate window.
void XimIC::unsetFocus()
{
if (!mIsActive)
@@ -415,14 +418,6 @@
mIsActive = false;
nrActiveIC--;
m_kkContext->focusOut();
- // Since the sequence of XIM_SET_IC_FOCUS and XIM_UNSET_FOCUS
- // events is not consistent, unsetting focus of candidate window
- // is now handled in XimIC::setFocus() and focus_in message from
- // helper application.
- //
- // if (mConvdisp && m_kkContext->hasActiveCandwin()) {
- // mConvdisp->unset_focus();
- // }
}
void XimIC::OnKeyEvent(keyEventX e)
Modified: branches/0.4/xim/ximserver.cpp
===================================================================
--- branches/0.4/xim/ximserver.cpp 2005-08-31 16:38:28 UTC (rev 1366)
+++ branches/0.4/xim/ximserver.cpp 2005-08-31 16:54:16 UTC (rev 1367)
@@ -305,7 +305,7 @@
mFocusedContext = NULL;
if (mConvdisp)
- mConvdisp->set_pe(0);
+ mConvdisp->set_pe(NULL);
delete m_pe;
uim_release_context(mUc);
@@ -451,6 +451,13 @@
InputContext::focusOut()
{
uim_helper_client_focus_out(mUc);
+ if (mFocusedContext == this) {
+ Canddisp *disp = canddisp_singleton();
+ if (isCaretStateShown())
+ disp->hide_caret_state();
+ if (hasActiveCandwin())
+ disp->hide();
+ }
}
XimServer *
@@ -471,7 +478,7 @@
InputContext *ic = (InputContext *)ptr;
XimIC *xic = ic->get_ic();
- clear_cb(ptr);
+ ic->clear_pe_stat();
ic->update_preedit();
xic->commit_string(str);
}
@@ -479,7 +486,7 @@
void InputContext::clear_cb(void *ptr)
{
InputContext *ic = (InputContext *)ptr;
- ic->clear_preedit();
+ ic->clear_pe_stat();
}
void InputContext::pushback_cb(void *ptr, int attr, const char *str)
@@ -534,11 +541,18 @@
ic->update_prop_label(str);
}
-void InputContext::clear_preedit()
+void InputContext::clear_pe_stat()
{
m_pe->clear();
}
+void InputContext::clear_preedit()
+{
+ clear_pe_stat();
+ if (mConvdisp)
+ mConvdisp->clear_preedit();
+}
+
uString InputContext::get_preedit_string()
{
uString str;
@@ -614,11 +628,10 @@
return mCandwinActive;
}
+// reset
void InputContext::clear()
{
clear_preedit();
- if (mConvdisp)
- mConvdisp->clear_preedit();
candidate_deactivate();
uim_reset_context(mUc);
}
Modified: branches/0.4/xim/ximserver.h
===================================================================
--- branches/0.4/xim/ximserver.h 2005-08-31 16:38:28 UTC (rev 1366)
+++ branches/0.4/xim/ximserver.h 2005-08-31 16:54:16 UTC (rev 1367)
@@ -193,15 +193,15 @@
static void update_prop_label_cb(void *ptr, const char *str);
static InputContext *focusedContext();
static void deletefocusedContext();
-protected:
+private:
void commit_string(char *);
+ void clear_pe_stat();
+
XimIC *mXic;
XimServer *mServer;
pe_stat *m_pe;
Convdisp *mConvdisp;
uim_context mUc;
-private:
- static InputContext *mFocusedContext;
bool mCandwinActive;
int mDisplayLimit;
int mNumPage;
@@ -211,6 +211,8 @@
char *mEngineName;
char *mLocaleName;
bool mCaretStateShown;
+private:
+ static InputContext *mFocusedContext;
};
class Locale {
More information about the uim-commit
mailing list