Skip to content

Fix window management: handle AirDrop picker cancellation and clean up source window#24

Open
hrueger wants to merge 1 commit into
vldmrkl:mainfrom
hrueger:fix-window-management-cancellation
Open

Fix window management: handle AirDrop picker cancellation and clean up source window#24
hrueger wants to merge 1 commit into
vldmrkl:mainfrom
hrueger:fix-window-management-cancellation

Conversation

@hrueger

@hrueger hrueger commented Jun 28, 2026

Copy link
Copy Markdown

First of all, thanks for this cool project. I've been using it, but I found a bug: when cancelling the AirDrop dialog (at least on Tahoe), the process does not exit and I keep seeing a small transparent window with a border. This PR fixes it.

Summary

  • Make the sharing source window invisible (borderless, transparent, non-key) to avoid visual artifacts
  • Track when sharing completes so cancellation can be distinguished from success/failure
  • Observe NSWindow.willCloseNotification to detect when the AirDrop picker is dismissed without a recipient selection, exiting cleanly on cancel
  • Clean up the observer and source window in all code paths

Note

This PR was generated with Claude Code and should be reviewed with a grain of salt.

…p source window

- Make the sharing source window invisible (borderless, transparent, non-key)
- Track sharing completion to distinguish cancellation from success/failure
- Observe NSWindow.willCloseNotification to detect picker dismissal without a recipient, exiting cleanly on cancel
- Clean up the observer and source window in all code paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vldmrkl

vldmrkl commented Jul 4, 2026

Copy link
Copy Markdown
Owner

@hrueger Thanks for your contribution!

Could you please provide more details on the steps to reproduce this issue? I can't easily reproduce it by cancelling the AirDrop.

Also, before / after screen recordings would be amazing.

@vldmrkl vldmrkl self-requested a review July 4, 2026 22:14
@hrueger

hrueger commented Jul 5, 2026

Copy link
Copy Markdown
Author

Please see the following video. When cancelling the dialog, the hidden window with the shadow stays. Also, you can see in the right terminal (htop) that the process keeps running until I kill it in the left terminal with Ctrl+C.

Bildschirmaufnahme.2026-07-05.um.09.32.00.mov

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