Previously, even though the zoom button was disabled the user could still double-click on the title bar to zoom the window. Prevent that by returning the appropriate value from `NSWindow windowShouldZoom` and move the `CanZoom` logic into a central place for use by this method and `UpdateStyle`.
Sometimes, after `windowDidBecomeKey` is called and the window order is enforced via `BringToFront`, the window that became key is then moved to the front, breaking window order. Given that we're already invalidating the shadow by scheduling it on the dispatcher, use this opportunity to also enforce the window order again.
Fixes a problem where we were clearing the fullscreen flag erroneously during a fullscreen transition, and in general it's best to preserve flags we're not interested in controlling anyway.
When a window exits fullscreen, its child windows need to be ordered, but we shouldn't touch the z-order of the window itself as this sometimes seemed to result in the parent window being shown over the child windows. Fixes flaky integration tests (hopefully).
macOS seems to tie resizing of the NSView inside the window to the resizable style mask of the window somehow. If we programmatically transition a non-resizable window to fullscreen, the inner NSView's size isn't changed, so we need to make the window resizable during the fullscreen transition.
Makes the final two failing `WindowState` integration tests pass.
- Make naming more clear - it's not getting the style mask, it's calculating what it should be in order to update the mask
- Make it abstract to prevent it being called from the ctor in future
To do this more easily, merged `HideOrShowTrafficLights` into a virtual `UpdateStyle`. They were always called together, and really _must_ be called together; this enforces that.
7eb95255c regressed disabling the minimize button on owned windows. Split what was previously `IsDialog` into two flags: `IsModal` and `IsOwned` and use `IsOwned` to control the disabled state of the minimize button.
This was preventing owner windows of non-modal dialogs from receiving key window status, meaning that input was broken in combination with embedding (Avalonia controls did work however because the routing was carried out internal to Avalonia).
When a window is closed, its parent window is set to null, which caused this code to run. This line caused the parent window to be brought to front, and should have also caused any other child windows to be brought to front, but it seems OSX ignored those requests, causing #8878.
Simply don't bring the parent window to the front when a child window is closed. I couldn't work out why this code was necessary anyway, and all integration tests still pass.
Fixes#8878.