You need to sign in or sign up before continuing.
提交 d10f1376 编写于 作者: D dcherepanov

6826397: PIT : Frame System Menu is not seen for when ALT + Space Bar is pressed in jdk7 b55 build.

Reviewed-by: art, ant
上级 c7fc8929
...@@ -109,7 +109,6 @@ AwtFrame::AwtFrame() { ...@@ -109,7 +109,6 @@ AwtFrame::AwtFrame() {
m_isMenuDropped = FALSE; m_isMenuDropped = FALSE;
m_isInputMethodWindow = FALSE; m_isInputMethodWindow = FALSE;
m_isUndecorated = FALSE; m_isUndecorated = FALSE;
m_proxyFocusOwner = NULL;
m_lastProxiedFocusOwner = NULL; m_lastProxiedFocusOwner = NULL;
m_actualFocusedWindow = NULL; m_actualFocusedWindow = NULL;
m_iconic = FALSE; m_iconic = FALSE;
...@@ -127,7 +126,6 @@ AwtFrame::~AwtFrame() ...@@ -127,7 +126,6 @@ AwtFrame::~AwtFrame()
void AwtFrame::Dispose() void AwtFrame::Dispose()
{ {
DestroyProxyFocusOwner();
AwtWindow::Dispose(); AwtWindow::Dispose();
} }
...@@ -308,22 +306,9 @@ done: ...@@ -308,22 +306,9 @@ done:
return frame; return frame;
} }
LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message, LRESULT AwtFrame::ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, MsgRouting &mr)
WPARAM wParam, LPARAM lParam)
{ {
TRY; LRESULT retValue = 0L;
DASSERT(::IsWindow(hwnd));
AwtFrame *parent = (AwtFrame *)
AwtComponent::GetComponentImpl(::GetParent(hwnd));
if (!parent || parent->GetProxyFocusOwner() != hwnd ||
message == AwtComponent::WmAwtIsComponent ||
message == WM_GETOBJECT)
{
return ComCtl32Util::GetInstance().DefWindowProc(NULL, hwnd, message, wParam, lParam);
}
AwtComponent *focusOwner = NULL; AwtComponent *focusOwner = 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
...@@ -346,19 +331,23 @@ LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message, ...@@ -346,19 +331,23 @@ LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message,
// 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(parent->GetLastProxiedFocusOwner()); focusOwner = AwtComponent::GetComponent(GetLastProxiedFocusOwner());
if (focusOwner != NULL) { if (focusOwner != NULL &&
return focusOwner->WindowProc(message, wParam, lParam); focusOwner != this) // avoid recursive calls
{
retValue = focusOwner->WindowProc(message, wParam, lParam);
mr = mrConsume;
} }
break; break;
case WM_SETFOCUS: case WM_SETFOCUS:
if (!sm_suppressFocusAndActivation && parent->IsEmbeddedFrame()) { if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
parent->AwtSetActiveWindow(); AwtSetActiveWindow();
} }
return 0; mr = mrConsume;
break;
case WM_KILLFOCUS: case WM_KILLFOCUS:
if (!sm_suppressFocusAndActivation && parent->IsEmbeddedFrame()) { if (!sm_suppressFocusAndActivation && IsEmbeddedFrame()) {
AwtWindow::SynthesizeWmActivate(FALSE, parent->GetHWnd(), NULL); AwtWindow::SynthesizeWmActivate(FALSE, GetHWnd(), NULL);
} else if (sm_restoreFocusAndActivation) { } else if (sm_restoreFocusAndActivation) {
if (AwtComponent::GetFocusedWindow() != NULL) { if (AwtComponent::GetFocusedWindow() != NULL) {
...@@ -369,64 +358,28 @@ LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message, ...@@ -369,64 +358,28 @@ LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message,
} }
} }
} }
return 0; mr = mrConsume;
break;
case 0x0127: // WM_CHANGEUISTATE case 0x0127: // WM_CHANGEUISTATE
case 0x0128: // WM_UPDATEUISTATE case 0x0128: // WM_UPDATEUISTATE
return 0; mr = mrConsume;
} break;
return parent->WindowProc(message, wParam, lParam);
CATCH_BAD_ALLOC_RET(0);
}
void AwtFrame::CreateProxyFocusOwner()
{
if (AwtToolkit::IsMainThread()) {
AwtFrame::_CreateProxyFocusOwner((void *)this);
} else {
AwtToolkit::GetInstance().InvokeFunction(AwtFrame::_CreateProxyFocusOwner, (void *)this);
} }
}
void AwtFrame::_CreateProxyFocusOwner(void *param)
{
DASSERT(AwtToolkit::IsMainThread());
AwtFrame *f = (AwtFrame *)param;
DASSERT(f->m_proxyFocusOwner == NULL);
f->m_proxyFocusOwner = ::CreateWindow(TEXT("STATIC"), return retValue;
TEXT("ProxyFocusOwner"),
WS_CHILD,
0, 0, 0, 0, f->GetHWnd(), NULL,
AwtToolkit::GetInstance().
GetModuleHandle(),
NULL);
f->m_proxyDefWindowProc = ComCtl32Util::GetInstance().SubclassHWND(f->m_proxyFocusOwner, ProxyWindowProc);
} }
void AwtFrame::DestroyProxyFocusOwner() LRESULT AwtFrame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{ {
// proxy focus owner must be destroyed on toolkit thread only MsgRouting mr = mrDoDefault;
if (AwtToolkit::IsMainThread()) { LRESULT retValue = 0L;
AwtFrame::_DestroyProxyFocusOwner((void *)this);
} else {
AwtToolkit::GetInstance().InvokeFunction(AwtFrame::_DestroyProxyFocusOwner, (void *)this);
}
}
void AwtFrame::_DestroyProxyFocusOwner(void *param) retValue = ProxyWindowProc(message, wParam, lParam, mr);
{
DASSERT(AwtToolkit::IsMainThread());
AwtFrame *f = (AwtFrame *)param; if (mr != mrConsume) {
if (f->m_proxyFocusOwner != NULL) { retValue = AwtWindow::WindowProc(message, wParam, lParam);
HWND toDestroy = f->m_proxyFocusOwner;
f->m_proxyFocusOwner = NULL;
ComCtl32Util::GetInstance().UnsubclassHWND(toDestroy, ProxyWindowProc, f->m_proxyDefWindowProc);
::DestroyWindow(toDestroy);
} }
return retValue;
} }
MsgRouting AwtFrame::WmShowWindow(BOOL show, UINT status) MsgRouting AwtFrame::WmShowWindow(BOOL show, UINT status)
......
...@@ -96,6 +96,8 @@ public: ...@@ -96,6 +96,8 @@ public:
AwtMenuBar* GetMenuBar(); AwtMenuBar* GetMenuBar();
void SetMenuBar(AwtMenuBar*); void SetMenuBar(AwtMenuBar*);
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
MsgRouting WmGetMinMaxInfo(LPMINMAXINFO lpmmi); MsgRouting WmGetMinMaxInfo(LPMINMAXINFO lpmmi);
MsgRouting WmSize(UINT type, int w, int h); MsgRouting WmSize(UINT type, int w, int h);
MsgRouting WmActivate(UINT nState, BOOL fMinimized, HWND opposite); MsgRouting WmActivate(UINT nState, BOOL fMinimized, HWND opposite);
...@@ -117,10 +119,7 @@ public: ...@@ -117,10 +119,7 @@ public:
INLINE BOOL IsUndecorated() { return m_isUndecorated; } INLINE BOOL IsUndecorated() { return m_isUndecorated; }
INLINE HWND GetProxyFocusOwner() { INLINE HWND GetProxyFocusOwner() {
if (m_proxyFocusOwner == NULL) { return GetHWnd();
CreateProxyFocusOwner();
}
return m_proxyFocusOwner;
} }
void SetMaximizedBounds(int x, int y, int w, int h); void SetMaximizedBounds(int x, int y, int w, int h);
...@@ -159,15 +158,7 @@ protected: ...@@ -159,15 +158,7 @@ protected:
BOOL m_isUndecorated; BOOL m_isUndecorated;
private: private:
static LRESULT CALLBACK ProxyWindowProc(HWND hwnd, UINT message, LRESULT ProxyWindowProc(UINT message, WPARAM wParam, LPARAM lParam, MsgRouting &mr);
WPARAM wParam, LPARAM lParam);
void CreateProxyFocusOwner();
void DestroyProxyFocusOwner();
/* creates proxy focus owner, called on Toolkit thread */
static void _CreateProxyFocusOwner(void *param);
/* destroys proxy focus owner, called on Toolkit thread */
static void _DestroyProxyFocusOwner(void *param);
/* The frame's embedding parent (if any) */ /* The frame's embedding parent (if any) */
HWND m_parentWnd; HWND m_parentWnd;
...@@ -188,10 +179,6 @@ private: ...@@ -188,10 +179,6 @@ private:
/* The frame is an InputMethodWindow */ /* The frame is an InputMethodWindow */
BOOL m_isInputMethodWindow; BOOL m_isInputMethodWindow;
/* Receives all keyboard input when an AwtWindow which is not an AwtFrame
or an AwtDialog (or one of its children) has the logical input focus. */
HWND m_proxyFocusOwner;
/* Retains the last/current sm_focusOwner proxied. Actually, it should be /* Retains the last/current sm_focusOwner proxied. Actually, it should be
* a component of an owned window last/currently active. */ * a component of an owned window last/currently active. */
HWND m_lastProxiedFocusOwner; HWND m_lastProxiedFocusOwner;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册