Skip to content

Prevent macOS dock miniwindow preview from rendering blank#26

Merged
kiyarose merged 3 commits into
mainfrom
copilot/bugfix-macos-window-disappears
Jun 1, 2026
Merged

Prevent macOS dock miniwindow preview from rendering blank#26
kiyarose merged 3 commits into
mainfrom
copilot/bugfix-macos-window-disappears

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 30, 2026

On macOS, the Dock preview (miniwindow image) could intermittently disappear after minimizing, while the app itself remained functional. Reopening and re-minimizing temporarily restored it, indicating unstable preview capture during miniaturization.

  • Root cause mitigation: deterministic miniwindow image

    • Added windowWillMiniaturize(_:) in AppDelegate to capture window content immediately before minimize.
    • Explicitly assigns the captured image to NSWindow.miniwindowImage, avoiding reliance on inconsistent implicit snapshotting.
  • Supporting utility: view snapshot helper

    • Added a private NSView.snapshotImage() helper that:
      • guards zero-size bounds,
      • caches display into a bitmap representation,
      • returns an NSImage suitable for Dock miniwindow usage.
func windowWillMiniaturize(_ notification: Notification) {
    guard
        let miniaturizingWindow = notification.object as? NSWindow,
        let image = miniaturizingWindow.contentView?.snapshotImage()
    else { return }

    miniaturizingWindow.miniwindowImage = image
}

Copilot AI linked an issue May 30, 2026 that may be closed by this pull request
@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented May 30, 2026

DeepSource Code Review

We reviewed changes in 35a6fce...342c9e3 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Rust Jun 1, 2026 12:22p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

Copilot AI changed the title [WIP] Fix window disappearing in dock on macOS Prevent macOS dock miniwindow preview from rendering blank May 30, 2026
Copilot AI requested a review from kiyarose May 30, 2026 22:17
@kiyarose kiyarose marked this pull request as ready for review June 1, 2026 12:12
@kiyarose kiyarose enabled auto-merge June 1, 2026 12:22
@kiyarose kiyarose marked this pull request as draft June 1, 2026 12:22
auto-merge was automatically disabled June 1, 2026 12:22

Pull request was converted to draft

@kiyarose kiyarose marked this pull request as ready for review June 1, 2026 12:22
@kiyarose kiyarose enabled auto-merge June 1, 2026 12:22
@kiyarose kiyarose merged commit 66dabe5 into main Jun 1, 2026
4 of 5 checks passed
@kiyarose kiyarose deleted the copilot/bugfix-macos-window-disappears branch June 1, 2026 12:28
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.

Bug: macOS — Window disappears in the dock

2 participants