[OS/2] Bug 353011: make bookmark tooltips and popups appear in front of the bookmarks menu, p=mz@scntt.de, r=me

This commit is contained in:
mozilla@weilbacher.org 2008-03-18 02:35:49 -07:00
parent acfc191b35
commit cc0fe5279f
2 changed files with 35 additions and 15 deletions

View File

@ -1188,22 +1188,24 @@ void nsWindow::NS2PM( RECTL &rcl)
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
NS_METHOD nsWindow::Show(PRBool bState) NS_METHOD nsWindow::Show(PRBool bState)
{ {
// doesn't seem to require a message queue. // doesn't seem to require a message queue.
if( mWnd) if (mWnd) {
{ if (bState) {
HWND hwnd = GetMainWindow(); // don't try to show new windows (e.g. the Bookmark menu)
if( bState == PR_TRUE) // during a native dragover because they'll remain invisible;
{ if (CheckDragStatus(ACTION_SHOW, 0)) {
// don't try to show new windows (e.g. the Bookmark menu) PRBool bVisible;
// during a native dragover because they'll remain invisible; IsVisible(bVisible);
if (CheckDragStatus(ACTION_SHOW, 0)) if (!bVisible)
WinShowWindow( hwnd, TRUE); PlaceBehind(eZPlacementTop, NULL, PR_FALSE);
WinShowWindow(mWnd, PR_TRUE);
} }
else } else {
WinShowWindow( hwnd, FALSE); WinShowWindow(mWnd, PR_FALSE);
} }
}
return NS_OK; return NS_OK;
} }
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
@ -1226,7 +1228,11 @@ NS_METHOD nsWindow::IsVisible(PRBool & bState)
NS_METHOD nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, NS_METHOD nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate) nsIWidget *aWidget, PRBool aActivate)
{ {
HWND behind = aWidget ? (HWND)aWidget->GetNativeData(NS_NATIVE_WINDOW) : HWND_TOP; HWND behind = HWND_TOP;
if (aPlacement == eZPlacementBottom)
behind = HWND_BOTTOM;
else if (aPlacement == eZPlacementBelow && aWidget)
behind = (HWND)aWidget->GetNativeData(NS_NATIVE_WINDOW);
UINT flags = SWP_ZORDER; UINT flags = SWP_ZORDER;
if (aActivate) if (aActivate)
flags |= SWP_ACTIVATE; flags |= SWP_ACTIVATE;
@ -1235,6 +1241,19 @@ NS_METHOD nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
return NS_OK; return NS_OK;
} }
//-------------------------------------------------------------------------
//
// Sets widget's position within its parent child list.
//
//-------------------------------------------------------------------------
NS_METHOD nsWindow::SetZIndex(PRInt32 aZIndex)
{
// nsBaseWidget::SetZIndex() never has done anything sensible but has
// randomly placed widgets behind others (see bug 117730#c25).
// To get bug #353011 solved simply override it here to do nothing.
return NS_OK;
}
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// //
// Maximize, minimize or restore the window. // Maximize, minimize or restore the window.

View File

@ -151,6 +151,7 @@ class nsWindow : public nsBaseWidget,
NS_IMETHOD IsVisible( PRBool &aState); NS_IMETHOD IsVisible( PRBool &aState);
NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, NS_IMETHOD PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
nsIWidget *aWidget, PRBool aActivate); nsIWidget *aWidget, PRBool aActivate);
NS_IMETHOD SetZIndex(PRInt32 aZIndex);
NS_IMETHOD CaptureMouse(PRBool aCapture); NS_IMETHOD CaptureMouse(PRBool aCapture);