зеркало из https://github.com/mozilla/pjs.git
Rollup code for native menu interaction is sensitive to runloop changes. Adding this code isn't really necessary right now, but it ensures the correct behavior even if native runloop handling changes. b=348371 r=mark sr=pinkerton
This commit is contained in:
Родитель
b27aafad3f
Коммит
0d5de6bb27
|
@ -44,6 +44,7 @@
|
|||
#include "nsIComponentManager.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "prinrval.h"
|
||||
#include "nsIRollupListener.h"
|
||||
|
||||
#include "nsMenuX.h"
|
||||
#include "nsMenuBarX.h"
|
||||
|
@ -69,6 +70,9 @@
|
|||
|
||||
#include "nsCRT.h"
|
||||
|
||||
// externs defined in nsWindow.cpp
|
||||
extern nsIRollupListener * gRollupListener;
|
||||
extern nsIWidget * gRollupWidget;
|
||||
|
||||
static OSStatus InstallMyMenuEventHandler(MenuRef menuRef, void* userData, EventHandlerRef* outHandler) ;
|
||||
|
||||
|
@ -698,6 +702,11 @@ static pascal OSStatus MyMenuEventHandler(EventHandlerCallRef myHandler, EventRe
|
|||
}
|
||||
}
|
||||
else if (kind == kEventMenuOpening || kind == kEventMenuClosed) {
|
||||
if (kind == kEventMenuOpening && gRollupListener != nsnull && gRollupWidget != nsnull) {
|
||||
gRollupListener->Rollup();
|
||||
return userCanceledErr;
|
||||
}
|
||||
|
||||
nsISupports* supports = reinterpret_cast<nsISupports*>(userData);
|
||||
nsCOMPtr<nsIMenuListener> listener(do_QueryInterface(supports));
|
||||
if (listener) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче