mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 16:32:59 +00:00
parent
8d094526f0
commit
bba49b51a5
@ -370,6 +370,13 @@ MRESULT nsFrameWindow::FrameMessage( ULONG msg, MPARAM mp1, MPARAM mp2)
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_ADJUSTWINDOWPOS:
|
||||
{
|
||||
PSWP pswp = (PSWP)mp1;
|
||||
if (pswp->fl & SWP_ZORDER)
|
||||
ConstrainZLevel(&pswp->hwndInsertBehind);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
WinSubclassWindow( mFrameWnd, fnwpDefFrame);
|
||||
WinSetWindowPtr( mFrameWnd, QWL_USER, 0);
|
||||
|
@ -1978,6 +1978,43 @@ PRBool nsWindow::OnKey( MPARAM mp1, MPARAM mp2)
|
||||
return rc;
|
||||
}
|
||||
|
||||
void nsWindow::ConstrainZLevel(HWND *aAfter) {
|
||||
|
||||
nsZLevelEvent event;
|
||||
nsWindow *aboveWindow = 0;
|
||||
|
||||
event.eventStructType = NS_ZLEVEL_EVENT;
|
||||
InitEvent(event, NS_SETZLEVEL);
|
||||
|
||||
if (*aAfter == HWND_BOTTOM)
|
||||
event.mPlacement = nsWindowZBottom;
|
||||
else if (*aAfter == HWND_TOP)
|
||||
event.mPlacement = nsWindowZTop;
|
||||
else {
|
||||
event.mPlacement = nsWindowZRelative;
|
||||
aboveWindow = GetNSWindowPtr(*aAfter);
|
||||
}
|
||||
event.mReqBelow = aboveWindow;
|
||||
event.mActualBelow = nsnull;
|
||||
|
||||
event.mImmediate = PR_FALSE;
|
||||
event.mAdjusted = PR_FALSE;
|
||||
DispatchWindowEvent(&event);
|
||||
|
||||
if (event.mAdjusted) {
|
||||
if (event.mPlacement == nsWindowZBottom)
|
||||
*aAfter = HWND_BOTTOM;
|
||||
else if (event.mPlacement == nsWindowZTop)
|
||||
*aAfter = HWND_TOP;
|
||||
else {
|
||||
*aAfter = (HWND)event.mActualBelow->GetNativeData(NS_NATIVE_WINDOW);
|
||||
}
|
||||
}
|
||||
NS_IF_RELEASE(event.mActualBelow);
|
||||
NS_RELEASE(event.widget);
|
||||
}
|
||||
|
||||
|
||||
// 'Window procedure'
|
||||
PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc)
|
||||
{
|
||||
|
@ -280,6 +280,8 @@ protected:
|
||||
virtual PRBool DispatchResizeEvent( PRInt32 aClientX, PRInt32 aClientY);
|
||||
void DeferPosition( HWND, HWND, long, long, long, long, ULONG);
|
||||
|
||||
void ConstrainZLevel(HWND *aAfter);
|
||||
|
||||
// Enumeration of the methods which are accessable on the PM thread
|
||||
enum {
|
||||
CREATE,
|
||||
|
Loading…
Reference in New Issue
Block a user