diff --git a/widget/cocoa/nsAppShell.mm b/widget/cocoa/nsAppShell.mm index 8e8f53282b09..81f4a694f53f 100644 --- a/widget/cocoa/nsAppShell.mm +++ b/widget/cocoa/nsAppShell.mm @@ -83,6 +83,8 @@ class MacWakeLockListener final : public nsIDOMMozWakeLockListener { shouldKeepDisplayOn ? kIOPMAssertionTypeNoDisplaySleep : kIOPMAssertionTypeNoIdleSleep; IOPMAssertionID& assertionId = shouldKeepDisplayOn ? mAssertionNoDisplaySleepID : mAssertionNoIdleSleepID; + WAKE_LOCK_LOG("topic=%s, shouldKeepDisplayOn=%d", NS_ConvertUTF16toUTF8(aTopic).get(), + shouldKeepDisplayOn); // Note the wake lock code ensures that we're not sent duplicate // "locked-foreground" notifications when multiple wake locks are held. diff --git a/widget/gtk/WakeLockListener.cpp b/widget/gtk/WakeLockListener.cpp index 60af2837435e..8640614b5f8a 100644 --- a/widget/gtk/WakeLockListener.cpp +++ b/widget/gtk/WakeLockListener.cpp @@ -42,6 +42,10 @@ NS_IMPL_ISUPPORTS(WakeLockListener, nsIDOMMozWakeLockListener) StaticRefPtr WakeLockListener::sSingleton; +# define WAKE_LOCK_LOG(...) \ + MOZ_LOG(gLinuxWakeLockLog, mozilla::LogLevel::Debug, (__VA_ARGS__)) +static mozilla::LazyLogModule gLinuxWakeLockLog("LinuxWakeLock"); + enum DesktopEnvironment { FreeDesktop, GNOME, @@ -484,6 +488,8 @@ nsresult WakeLockListener::Callback(const nsAString& topic, // Treat "locked-background" the same as "unlocked" on desktop linux. bool shouldLock = state.EqualsLiteral("locked-foreground"); + WAKE_LOCK_LOG("topic=%s, shouldLock=%d", NS_ConvertUTF16toUTF8(topic).get(), + shouldLock); return shouldLock ? topicLock->InhibitScreensaver() : topicLock->UninhibitScreensaver();