Skip to content

🐞 Fix stutter when expanding and hiding custom notch#45

Merged
mrkai77 merged 5 commits into
mrkai77:mainfrom
GedeonIsezerano:main
Feb 9, 2026
Merged

🐞 Fix stutter when expanding and hiding custom notch#45
mrkai77 merged 5 commits into
mrkai77:mainfrom
GedeonIsezerano:main

Conversation

@GedeonIsezerano
Copy link
Copy Markdown
Contributor

Screen.Recording.2026-01-04.at.10.53.07.PM.mov

So, when expanding the dynamic notch, there is always a stutter that looks like it's trying to expand, and then it freezes and then fully expands. Something happens when it's collapsing. After it collapses, it looks like there's a stutter that seems as if it's not closing exactly, and then it fully closes.

GedeonIsezerano and others added 5 commits January 4, 2026 22:48
When expanding from hidden state, the window would briefly show an
intermediate frame before the animation started, causing a visual
"stutter" or "false start" appearance.

The fix has two parts:

1. Decouple window creation from display by adding an `orderFront`
   parameter to `initializeWindow()`. This allows creating the window
   and setting up the SwiftUI view hierarchy without immediately
   showing it.

2. In `showWindow()`, start with `alphaValue = 0` and fade in over
   0.15s. This masks any initial frame glitches that occur when
   AppKit/SwiftUI first renders the window.

3. Update `_expand()` and `_compact()` to:
   - Create window without showing it
   - Start the state animation
   - Then show window with fade-in

This ensures smooth, stutter-free animations when the notch first
appears.
Fix expand/compact animation stutter on initial appearance
Add fade-out before closing window to mask any visual glitches
during the closing animation.

- Reduced initial wait from 0.4s to 0.25s
- Added fadeOutWindow() that fades alpha to 0 over 0.15s
- Window now smoothly disappears instead of abruptly closing
Copy link
Copy Markdown
Owner

@mrkai77 mrkai77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the long delay in reviewing this. Thanks so much for your solution! I tested it and it works perfectly :)

@mrkai77 mrkai77 merged commit 645f165 into mrkai77:main Feb 9, 2026
@mrkai77 mrkai77 changed the title Fix stutter when expanding and hiding custom notch 🐞 Fix stutter when expanding and hiding custom notch Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants