Add option to pause breaks when another app is in full screen#1781
Open
dkumankov wants to merge 3 commits into
Open
Add option to pause breaks when another app is in full screen#1781dkumankov wants to merge 3 commits into
dkumankov wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #1781 +/- ##
==========================================
- Coverage 68.21% 62.83% -5.38%
==========================================
Files 15 17 +2
Lines 494 627 +133
==========================================
+ Hits 337 394 +57
- Misses 157 233 +76 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
hovancik
reviewed
May 25, 2026
Replaces inline PowerShell + Add-Type C# fullscreen detection with the windows-notification-state native addon (same author as windows-focus-assist already used here for DND). Also match QUNS_BUSY (2) alongside QUNS_RUNNING_D3D_FULL_SCREEN (3) and QUNS_PRESENTATION_MODE (4) — empirically what modern Windows returns for Chrome F11, fullscreen video and most games.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #355
Requirements
nodeversion specified inpackage.jsonwas used (ie using nvm).npm install --no-save).npm run lintreports no offenses.npm run testis error-free.Description of the Change
Adds an opt-in setting "Pause breaks while another app is in full screen" (
monitorFullscreenApp, defaultfalse) under Settings, right below the existing "Show breaks even in Do Not Disturb mode" toggle.When enabled, break scheduling is paused while another application is presenting in fullscreen, and resumes when fullscreen ends — symmetrical to how
monitorDndworks today.Architecture. A new
FullscreenAppManager(app/utils/fullscreenAppManager.js) mirrorsDndManager:EventEmitterstart()/stop()lifecycleisOnFullscreenAppbooleanfullscreenAppStarted/fullscreenAppFinishedBreaksPlannerconstructs it, subscribes to its events, and exposes afullscreenApp(shouldUse)method symmetrical todoNotDisturb(shouldUse).main.jsaddsisOnFullscreenAppto the existing guard expressions (onSuspendOrLock,trayIconPath, the two tray-menu branches,resumeBreaks) so the manager participates in all the same "is Stretchly currently suppressed" checks as DND and app exclusions.Cross-platform detection — no new dependencies:
getFocusAssist()from the already-presentwindows-focus-assist(state 3 = D3D fullscreen, 4 = presentation mode) OR a persistent PowerShell worker that compares the foreground window'sGetWindowRectto its monitor'srcMonitor— catches borderless-windowed games and browser F11 that the notification-state API alone reports asBUSY.osascriptreadingAXFullScreenof the frontmost window — same shell-out pattern asdndManager's macOS path.xdotool getactivewindow+xprop _NET_WM_STATElooking for_NET_WM_STATE_FULLSCREEN.false.i18n strings added across all 49 locales that currently expose the
preferences.settingsnamespace (5 incomplete locales —arz,bn,cy,eu,sr— fall back to English at runtime, matching Stretchly's existing pattern).Verification Process
Automated
npm run lint— clean.npm run test— passes, including 8 new unit tests intest/fullscreenAppManager.jscovering: default-off state,start()/stop()lifecycle,start()idempotency, rising-edge / falling-edge emission,_detectFullscreenno-op when disabled, log-once behavior on detection errors.test/translations.js) — all 54 files valid.Manual (Windows 11)
monitorFullscreenAppin Preferencesstarting fullscreen app monitoringpausing breaks because a fullscreen app is activewithin ~2 s; tray icon switches to paused styleresuming breaks after fullscreen app is no longer active; tray icon returns to normalscheduler.reference === 'finishBreak'doNotDisturb(false))Regression checks: the existing DND / app-exclusion / suspend-lock paths continue to behave the same way — all guards that previously read
isPaused || isOnDnd || isSchedulerClearednow additionally includeisOnFullscreenApp, but the OR-of-booleans is purely additive.Other information
stop(). No process is created at all on macOS/Linux.SHQueryUserNotificationStateOR bounds-equals-monitor) was added after observing that modern games like Crimson Desert run in borderless-windowed mode rather than exclusive D3D fullscreen, so the notification-state API alone misses them."0-fullscreen"-token-inside-appExclusionsdesign you sketched in issue #355's 2023 comment if you prefer that integration; the manager itself stays the same, only the wiring changes.