From b827b6f2ebeaa93dd32755f6922c46324dccf4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Sun, 15 Aug 2010 14:29:11 +0200 Subject: [PATCH] Backed out changeset 05dde680ade2 as per bug 575870 comment 71 --- widget/src/windows/nsWindow.cpp | 13 +++++++++++-- widget/src/windows/nsWindow.h | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index f231867a1e2..3a557ea99c2 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -378,6 +378,7 @@ nsWindow::nsWindow() : nsBaseWidget() mDisplayPanFeedback = PR_FALSE; mTouchWindow = PR_FALSE; mCustomNonClient = PR_FALSE; + mCompositorFlag = PR_FALSE; mHideChrome = PR_FALSE; mWindowType = eWindowType_child; mBorderStyle = eBorderStyle_default; @@ -1988,6 +1989,13 @@ nsWindow::UpdateNonClientMargins(PRInt32 aSizeMode, PRBool aReflowWindow) if (!mCustomNonClient) return PR_FALSE; + // XXX Temp disable margins until frame rendering is supported + mCompositorFlag = PR_TRUE; + if(!nsUXThemeData::CheckForCompositor()) { + mCompositorFlag = PR_FALSE; + return PR_FALSE; + } + mNonClientOffset.top = mNonClientOffset.bottom = mNonClientOffset.left = mNonClientOffset.right = 0; @@ -4564,6 +4572,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // Glass hit testing w/custom transparent margins LRESULT dwmHitResult; if (mCustomNonClient && + mCompositorFlag && nsUXThemeData::CheckForCompositor() && nsUXThemeData::dwmDwmDefWindowProcPtr(mWnd, msg, wParam, lParam, &dwmHitResult)) { *aRetValue = dwmHitResult; @@ -4704,7 +4713,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, // copies the valid information to the specified area within the new // client area. If the wParam parameter is FALSE, the application should // return zero. - if (mCustomNonClient) { + if (mCustomNonClient && mCompositorFlag) { if (!wParam) { result = PR_TRUE; *aRetValue = 0; @@ -4744,7 +4753,7 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam, * composited desktop. */ - if (!mCustomNonClient) + if (!mCustomNonClient || !mCompositorFlag) break; *aRetValue = diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index e360cf50abc..0599b52d9f2 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -501,6 +501,8 @@ protected: nsIntMargin mNonClientMargins; // Indicates custom frames are enabled PRPackedBool mCustomNonClient; + // Disable non client margins on non-comsitor desktops + PRPackedBool mCompositorFlag; // Cached copy of L&F's resize border PRInt32 mHorResizeMargin; PRInt32 mVertResizeMargin;