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