mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Contextmenu doesn't disappear correctly when Firefox is in background. Also, Firefox doesn't dismiss context menu when it is in the background and a user clicks on another application. b=339945 r=cbarrett sr=roc
This commit is contained in:
parent
63bdea3a2a
commit
cf1b2fda7d
@ -1133,6 +1133,10 @@ NS_IMETHODIMP nsCocoaWindow::GetAnimatedResize(PRUint16* aAnimation)
|
||||
|
||||
- (void)windowDidBecomeMain:(NSNotification *)aNotification
|
||||
{
|
||||
// roll up any popups
|
||||
if (gRollupListener != nsnull && gRollupWidget != nsnull)
|
||||
gRollupListener->Rollup();
|
||||
|
||||
NSWindow* window = [aNotification object];
|
||||
if (window)
|
||||
[WindowDelegate paintMenubarForWindow:window];
|
||||
|
@ -95,6 +95,8 @@ protected:
|
||||
nsresult RegisterForSleepWakeNotifcations();
|
||||
void RemoveSleepWakeNotifcations();
|
||||
|
||||
void RegisterForAllProcessMouseEvents();
|
||||
|
||||
protected:
|
||||
|
||||
bool mInited;
|
||||
|
@ -47,15 +47,22 @@
|
||||
#include <mach/mach_interface.h>
|
||||
#include <mach/mach_init.h>
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <Carbon/Carbon.h>
|
||||
#import <IOKit/pwr_mgt/IOPMLib.h>
|
||||
#import <IOKit/IOMessage.h>
|
||||
|
||||
#include "nsWidgetAtoms.h"
|
||||
#include "nsIRollupListener.h"
|
||||
#include "nsIWidget.h"
|
||||
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
// defined in nsChildView.mm
|
||||
extern nsIRollupListener * gRollupListener;
|
||||
extern nsIWidget * gRollupWidget;
|
||||
|
||||
static io_connect_t gRootPort = MACH_PORT_NULL;
|
||||
|
||||
// Static thread local storage index of the Toolkit
|
||||
@ -89,6 +96,7 @@ nsToolkit::Init(PRThread * aThread)
|
||||
mInited = true;
|
||||
|
||||
RegisterForSleepWakeNotifcations();
|
||||
RegisterForAllProcessMouseEvents();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -173,6 +181,26 @@ nsToolkit::RemoveSleepWakeNotifcations()
|
||||
}
|
||||
|
||||
|
||||
static OSStatus AllAppMouseEventHandler(EventHandlerCallRef aCaller, EventRef aEvent, void* aRefcon)
|
||||
{
|
||||
if (![NSApp isActive]) {
|
||||
if (gRollupListener != nsnull && gRollupWidget != nsnull)
|
||||
gRollupListener->Rollup();
|
||||
}
|
||||
|
||||
return noErr;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
nsToolkit::RegisterForAllProcessMouseEvents()
|
||||
{
|
||||
EventTypeSpec kEvents[] = {{kEventClassMouse, kEventMouseDown}};
|
||||
|
||||
InstallEventHandler(GetEventMonitorTarget(), AllAppMouseEventHandler, GetEventTypeCount(kEvents), kEvents, 0, NULL);
|
||||
}
|
||||
|
||||
|
||||
// Return the nsIToolkit for the current thread. If a toolkit does not
|
||||
// yet exist, then one will be created...
|
||||
NS_METHOD NS_GetCurrentToolkit(nsIToolkit* *aResult)
|
||||
|
Loading…
Reference in New Issue
Block a user