Bug 1554761 - Notify with a 'mac_app_activate' topic when the App has been activated, capturing Command-Tabbing behavior. OSX only. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D39936
This commit is contained in:
@@ -46,6 +46,9 @@
|
||||
#include "nsIDOMWakeLockListener.h"
|
||||
#include "nsIPowerManagerService.h"
|
||||
|
||||
#include "nsIObserverService.h"
|
||||
#include "mozilla/Services.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::widget;
|
||||
|
||||
@@ -881,6 +884,11 @@ nsAppShell::AfterProcessNextEvent(nsIThreadInternal* aThread, bool aEventWasProc
|
||||
[currentEvent modifierFlags] & NSDeviceIndependentModifierFlagsMask;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIObserverService> observerService = services::GetObserverService();
|
||||
if (observerService) {
|
||||
observerService->NotifyObservers(nullptr, NS_WIDGET_MAC_APP_ACTIVATE_OBSERVER_TOPIC, nullptr);
|
||||
}
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
|
||||
@@ -261,6 +261,12 @@ enum nsTopLevelWidgetZPlacement { // for PlaceBehind()
|
||||
*/
|
||||
#define NS_WIDGET_RESUME_PROCESS_OBSERVER_TOPIC "resume_process_notification"
|
||||
|
||||
/**
|
||||
* When an app(-shell) is activated by the OS, this topic is notified.
|
||||
* Currently, this only happens on Mac OSX.
|
||||
*/
|
||||
#define NS_WIDGET_MAC_APP_ACTIVATE_OBSERVER_TOPIC "mac_app_activate"
|
||||
|
||||
namespace mozilla {
|
||||
namespace widget {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user