提交 774386ef 编写于 作者: D dcherepanov

7034291: Regression : Preedit String on active client is committed into unexpected component

Reviewed-by: art, naoto
上级 495129e8
......@@ -1203,7 +1203,7 @@ void SpyWinMessage(HWND hwnd, UINT message, LPCTSTR szComment) {
WIN_MSG(WM_IME_COMPOSITIONFULL)
WIN_MSG(WM_IME_SELECT)
WIN_MSG(WM_IME_CHAR)
FMT_MSG(0x0288, "WM_IME_REQUEST")
FMT_MSG(WM_IME_REQUEST)
WIN_MSG(WM_IME_KEYDOWN)
WIN_MSG(WM_IME_KEYUP)
FMT_MSG(0x02A1, "WM_MOUSEHOVER")
......@@ -1733,7 +1733,7 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
case WM_IME_SELECT:
case WM_IME_KEYUP:
case WM_IME_KEYDOWN:
case 0x0288: // WM_IME_REQUEST
case WM_IME_REQUEST:
CallProxyDefWindowProc(message, wParam, lParam, retValue, mr);
break;
case WM_CHAR:
......@@ -4657,10 +4657,6 @@ void* AwtComponent::SetNativeFocusOwner(void *self) {
ret:
if (c && ::IsWindow(c->GetHWnd())) {
sm_focusOwner = c->GetHWnd();
AwtFrame *owner = (AwtFrame*)GetComponent(c->GetProxyToplevelContainer());
if (owner) {
owner->SetLastProxiedFocusOwner(sm_focusOwner);
}
} else {
sm_focusOwner = NULL;
}
......
......@@ -109,7 +109,7 @@ AwtFrame::AwtFrame() {
m_isMenuDropped = FALSE;
m_isInputMethodWindow = FALSE;
m_isUndecorated = FALSE;
m_lastProxiedFocusOwner = NULL;
m_imeTargetComponent = NULL;
m_actualFocusedWindow = NULL;
m_iconic = FALSE;
m_zoomed = FALSE;
......@@ -311,6 +311,8 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms
LRESULT retValue = 0L;
AwtComponent *focusOwner = NULL;
AwtComponent *imeTargetComponent = NULL;
// IME and input language related messages need to be sent to a window
// which has the Java input focus
switch (message) {
......@@ -323,15 +325,29 @@ LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, Ms
case WM_IME_COMPOSITIONFULL:
case WM_IME_SELECT:
case WM_IME_CHAR:
case 0x0288: // WM_IME_REQUEST
case WM_IME_REQUEST:
case WM_IME_KEYDOWN:
case WM_IME_KEYUP:
case WM_INPUTLANGCHANGEREQUEST:
case WM_INPUTLANGCHANGE:
if (message == WM_IME_STARTCOMPOSITION) {
SetImeTargetComponent(sm_focusOwner);
}
imeTargetComponent = AwtComponent::GetComponent(GetImeTargetComponent());
if (imeTargetComponent != NULL &&
imeTargetComponent != this) // avoid recursive calls
{
retValue = imeTargetComponent->WindowProc(message, wParam, lParam);
mr = mrConsume;
}
if (message == WM_IME_ENDCOMPOSITION) {
SetImeTargetComponent(NULL);
}
break;
// TODO: when a Choice's list is dropped down and we're scrolling in
// the list WM_MOUSEWHEEL messages come to the poxy, not to the list. Why?
case WM_MOUSEWHEEL:
focusOwner = AwtComponent::GetComponent(GetLastProxiedFocusOwner());
focusOwner = AwtComponent::GetComponent(sm_focusOwner);
if (focusOwner != NULL &&
focusOwner != this) // avoid recursive calls
{
......
......@@ -150,8 +150,8 @@ public:
void CheckRetainActualFocusedWindow(HWND activatedOpositeHWnd);
BOOL CheckActivateActualFocusedWindow(HWND deactivatedOpositeHWnd);
INLINE HWND GetLastProxiedFocusOwner() { return m_lastProxiedFocusOwner; }
INLINE void SetLastProxiedFocusOwner(HWND hwnd) { m_lastProxiedFocusOwner = hwnd; }
INLINE HWND GetImeTargetComponent() { return m_imeTargetComponent; }
INLINE void SetImeTargetComponent(HWND hwnd) { m_imeTargetComponent = hwnd; }
protected:
/* The frame is undecorated. */
......@@ -179,9 +179,8 @@ private:
/* The frame is an InputMethodWindow */
BOOL m_isInputMethodWindow;
/* Retains the last/current sm_focusOwner proxied. Actually, it should be
* a component of an owned window last/currently active. */
HWND m_lastProxiedFocusOwner;
// retains the target component for the IME messages
HWND m_imeTargetComponent;
/*
* Fix for 4823903.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册