Skip to content

fix(macos,linux): isolate macOS Dock/close-quit lifecycle and Linux Wayland presentation (v1.0.1) - #2

Merged
kthguru merged 2 commits into
mainfrom
fix/os-isolated-window-lifecycle
Nov 20, 2026
Merged

kthguru merged 2 commits into
mainfrom
fix/os-isolated-window-lifecycle

Conversation

@kthguru

@kthguru kthguru commented Nov 19, 2026

Copy link
Copy Markdown
Member

Summary

Strictly OS-isolated fixes for macOS AppKit and Linux GTK3/Wayland window lifecycle regressions discovered in v1.0.0. Zero files under lib/src/platform/windows/ or test/windows_window_test.dart were modified.

macOS (lib/src/platform/macos/)

  • Immediate Close-to-Tray response on traffic-light [X]: Wake Flutter's macOS CFRunLoop / Dart microtask queue (Timer.run + ensureVisualUpdate / scheduleFrame) inside MacOSWindowDelegateRegistry._onWindowShouldClose when a close request is cancelled, so hiding the window happens immediately without waiting for the pointer to exit the close button.
  • Automatic Dock running dot policy (Regular <-> Accessory): When MacOSWindowAdapter.hide() hides the last visible application window while an active NSStatusItem (visible NSStatusBarWindow) exists, switch NSApplication to Accessory (1) so the Dock indicator dot disappears while keeping the menu bar status item alive; restore Regular (0) before activation on show(), focus(), or native reopen (NSWindowDidBecomeKeyNotification).
  • Clean Dock Quit / Cmd+Q termination: Stop forwarding WidgetsBindingObserver.didRequestAppExit to WindowCloseRequestedEvent on macOS and Linux (preserving Windows WM_CLOSE forwarding), and automatically unlink single-instance Unix sockets via NSApplicationWillTerminateNotification (MacOSAppLifecycleObserver) and Application.quit().

Linux (lib/src/platform/linux/)

  • Wayland unmapped presentation & Mutter attention banner fix: Remove raw gdk_window_show / gdk_window_focus calls from LinuxWindowAdapter._presentWindow and resolve X11 vs Wayland presentation via resolveLinuxPresentAction so unmapped Wayland startup/restore uses gtk_window_deiconify + gtk_widget_show without firing premature gtk_window_present_with_time(0).
  • GTK3 pre-map geometry, native centering, maximized state, and close wakeup: Apply gtk_window_set_default_size + gdk_window_resize before map in setSize() / bounds =, delegate Window.center() to gtk_window_set_position(GTK_WIN_POS_CENTER), check GDK_WINDOW_STATE_MAXIMIZED alongside gtk_window_is_maximized, and wake Flutter's run loop when delete-event cancels close.

Verification

  • dart format --output=none --set-exit-if-changed . (0 changed)
  • dart analyze --fatal-infos --fatal-warnings (root + example: 0 issues)
  • flutter test (31/31 passed, including live macOS 27.2.1 Objective-C FFI probes)
  • dart pub global run pana --no-warning --json (160/160, 100.0% dartdoc)
  • dart pub publish --dry-run (0 warnings)
  • git diff main -- lib/src/platform/windows test/windows_window_test.dart (0 lines changed)

Integrate PR #1 (Linux gdk_event_set_device fix) and unify v1.0.1 CHANGELOG entries.
@kthguru
kthguru merged commit 3399787 into main Nov 20, 2026
4 checks passed
@kthguru
kthguru deleted the fix/os-isolated-window-lifecycle branch November 20, 2026 02:26
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.

1 participant