提交 681cd112 编写于 作者: A ant

6821291: assertion failure in awt_Frame.h

Reviewed-by: dcherepanov, art
上级 e402d87f
...@@ -381,19 +381,28 @@ LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message, ...@@ -381,19 +381,28 @@ LRESULT CALLBACK AwtFrame::ProxyWindowProc(HWND hwnd, UINT message,
void AwtFrame::CreateProxyFocusOwner() void AwtFrame::CreateProxyFocusOwner()
{ {
DASSERT(m_proxyFocusOwner == NULL); if (AwtToolkit::IsMainThread()) {
DASSERT(AwtToolkit::MainThread() == ::GetCurrentThreadId()); AwtFrame::_CreateProxyFocusOwner((void *)this);
} else {
m_proxyFocusOwner = ::CreateWindow(TEXT("STATIC"), AwtToolkit::GetInstance().InvokeFunction(AwtFrame::_CreateProxyFocusOwner, (void *)this);
TEXT("ProxyFocusOwner"), }
WS_CHILD, }
0, 0, 0, 0, GetHWnd(), NULL,
AwtToolkit::GetInstance().
GetModuleHandle(),
NULL);
m_proxyDefWindowProc = ComCtl32Util::GetInstance().SubclassHWND(m_proxyFocusOwner, ProxyWindowProc); void AwtFrame::_CreateProxyFocusOwner(void *param)
{
DASSERT(AwtToolkit::IsMainThread());
DASSERT(m_proxyFocusOwner == NULL);
AwtFrame *f = (AwtFrame *)param;
f->m_proxyFocusOwner = ::CreateWindow(TEXT("STATIC"),
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() void AwtFrame::DestroyProxyFocusOwner()
......
...@@ -117,7 +117,6 @@ public: ...@@ -117,7 +117,6 @@ public:
INLINE BOOL IsUndecorated() { return m_isUndecorated; } INLINE BOOL IsUndecorated() { return m_isUndecorated; }
INLINE HWND GetProxyFocusOwner() { INLINE HWND GetProxyFocusOwner() {
DASSERT(AwtToolkit::MainThread() == ::GetCurrentThreadId());
if (m_proxyFocusOwner == NULL) { if (m_proxyFocusOwner == NULL) {
CreateProxyFocusOwner(); CreateProxyFocusOwner();
} }
...@@ -165,6 +164,8 @@ private: ...@@ -165,6 +164,8 @@ private:
void CreateProxyFocusOwner(); void CreateProxyFocusOwner();
void DestroyProxyFocusOwner(); void DestroyProxyFocusOwner();
/* creates proxy focus owner, called on Toolkit thread */
static void _CreateProxyFocusOwner(void *param);
/* destroys proxy focus owner, called on Toolkit thread */ /* destroys proxy focus owner, called on Toolkit thread */
static void _DestroyProxyFocusOwner(void *param); static void _DestroyProxyFocusOwner(void *param);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册