[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)
{
// doesn't seem to require a message queue.
if( mWnd)
{
HWND hwnd = GetMainWindow();
if( bState == PR_TRUE)
{
// don't try to show new windows (e.g. the Bookmark menu)
// during a native dragover because they'll remain invisible;
if (CheckDragStatus(ACTION_SHOW, 0))
WinShowWindow( hwnd, TRUE);
// doesn't seem to require a message queue.
if (mWnd) {
if (bState) {
// don't try to show new windows (e.g. the Bookmark menu)
// during a native dragover because they'll remain invisible;
if (CheckDragStatus(ACTION_SHOW, 0)) {
PRBool bVisible;
IsVisible(bVisible);
if (!bVisible)
PlaceBehind(eZPlacementTop, NULL, PR_FALSE);
WinShowWindow(mWnd, PR_TRUE);
}
else
WinShowWindow( hwnd, FALSE);
}
} else {
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,
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;
if (aActivate)
flags |= SWP_ACTIVATE;
@ -1235,6 +1241,19 @@ NS_METHOD nsWindow::PlaceBehind(nsTopLevelWidgetZPlacement aPlacement,
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.

View File

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