Commit Graph
2 Commits
Author SHA1 Message Date
David Richardson af2edf6c97 AppKit: Implement window minimize with restore from Windows menu
Order minimized window off screen and keep it in Windows menu for restore. Enable minimize button for miniaturizable windows.

* CPWindow.j:
  - Order window out with attached sheet and visible child windows on miniaturize:; keep first responder and child windows for restore; ignore miniaturize: on minimized window.
  - Restore window, first responder and child windows when window orders front; post CPWindowDidDeminiaturizeNotification after restore.
  - Restore minimized window through makeKeyAndOrderFront: in deminiaturize:.
  - Remove calls to platform window's miniaturize: and deminiaturize:.
  - Minimize through performMiniaturize: only when window can minimize; enable performMiniaturize: and miniaturize: menu items under same condition.

* _CPStandardWindowView.j: Enable minimize button for miniaturizable windows and target window's miniaturize:.

* CPWindowTest.j: Add tests for restore, notification order, first responder restore, performMiniaturize: on non-miniaturizable window, minimize button action and menu validation.

* CPApplicationWindowsMenuTest.j: Add tests for minimized window listed in mixed state and restored from Windows menu.

* DropInCompatibilityTest.j: Replace test for minimize button never enabled with test for minimize button enabled only for miniaturizable windows.
2026-11-08 14:37:23 -06:00
David Richardson 055ae6d04e AppKit: List the application's windows in the Windows menu
The Window menu never listed the application's windows, because AppKit had none of Cocoa's Windows menu support.

* CPApplication.j: Add windowsMenu, setWindowsMenu:, addWindowsItem:title:filename:, changeWindowsItem:title:filename:, removeWindowsItem:, updateWindowsItem: and arrangeInFront:; find the menu named _CPWindowsMenu in the main menu, and list the visible windows when the main menu is set.

* CPWindow/CPWindow.j: Add isExcludedFromWindowsMenu and setExcludedFromWindowsMenu:, and keep the window's item current when the window is ordered in or out, retitled, made main or no longer main, miniaturized, deminiaturized or closed.

* Tests/AppKit/CPApplicationWindowsMenuTest.j: Add tests for listing, retitling, exclusion, the main window check mark, separator handling, file name titles and moving items to another Windows menu.

* Tests/Manual/TextEditor/WORKLIST.md: Remove the entry for this gap, and record the Window menu as tested.
2026-10-23 16:29:46 -06:00