зеркало из https://github.com/mozilla/gecko-dev.git
Changes for the photon platform - they should not affect build/runtime on other platforms.
nsWidget.cpp - fixed the problem with context menus not showing up in the Mail&News client. nsWindow.cpp - fixed a problem with the PtRegion underneath the menus not being realized in some cases ( not related to the change in nsWidget.cpp ).
This commit is contained in:
Родитель
1119884297
Коммит
a88533cedc
|
@ -1038,8 +1038,9 @@ inline PRBool nsWidget::HandleEvent( PtWidget_t *widget, PtCallbackInfo_t* aCbIn
|
|||
|
||||
// if we're a right-button-up we're trying to popup a context menu. send that event to gecko also
|
||||
if( ptrev->buttons & Ph_BUTTON_MENU ) {
|
||||
InitMouseEvent( ptrev, this, theMouseEvent, NS_CONTEXTMENU );
|
||||
result = DispatchMouseEvent( theMouseEvent );
|
||||
nsMouseEvent contextMenuEvent;
|
||||
InitMouseEvent( ptrev, this, contextMenuEvent, NS_CONTEXTMENU );
|
||||
result = DispatchMouseEvent( contextMenuEvent );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,9 @@ nsWindow::nsWindow()
|
|||
//-------------------------------------------------------------------------
|
||||
nsWindow::~nsWindow()
|
||||
{
|
||||
nsWindow *p = (nsWindow*)mParent;
|
||||
if( p && p->mLastMenu == mWidget ) p->mLastMenu = nsnull;
|
||||
|
||||
// always call destroy. if it's already been called, there's no harm
|
||||
// since it keeps track of when it's already been called.
|
||||
Destroy();
|
||||
|
@ -188,9 +191,10 @@ NS_IMETHODIMP nsWindow::CaptureRollupEvents( nsIRollupListener * aListener, PRBo
|
|||
|
||||
PtWidget_t *pw = ((nsWindow*)mParent)->mLastMenu;
|
||||
|
||||
if( pw && ( PtWidgetFlags( pw ) & Pt_REALIZED ) )
|
||||
if( pw && ( PtWidgetFlags( pw ) & Pt_REALIZED ) && PtWidgetRid( pw ) > 0 )
|
||||
PtSetResource( gMenuRegion, Pt_ARG_REGION_INFRONT, PtWidgetRid( pw ), 0 );
|
||||
else {
|
||||
if( !PtWidgetIsRealized( mWidget ) ) PtRealizeWidget( mWidget );
|
||||
PtSetResource( gMenuRegion, Pt_ARG_REGION_INFRONT, PtWidgetRid( mWidget ), 0 );
|
||||
((nsWindow*)mParent)->mLastMenu = mWidget;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче