Skip to content

fix(macos): Report Maximized when the window already fills the screen - #25727

Merged
ramezgerges merged 5 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/macos-small-screen-window
Oct 27, 2026
Merged

ramezgerges merged 5 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/macos-small-screen-window

Conversation

@ramezgerges

@ramezgerges ramezgerges commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25726, closes #25728

PR Type:

🐞 Bugfix

What changed? 🚀

Three macOS window tests failed on #25492, which moved the macOS lanes from the macOS-26 image to xcode-27. #25492 has since merged with the three tests disabled on macOS (#25728); this PR fixes them and turns them back on. Those VMs have a 1024×768 display, which leaves a 1024×649 usable area once the menu bar and Dock are taken out. The tests pass on macOS-26 only because its display is larger: the screen-size limits below are AppKit's, not new Uno behaviour. One failure is a real bug; the other two were tests that couldn't work on a screen that small.

The bug: Maximize() reported Restored for a window that already fills the screen. uno_window_maximize skips zoom: when AppKit says the window is already zoomed. Only the zoom: override records the presenter state, so nothing recorded Maximized. On a small screen that's the normal case, because AppKit fits a new window to the visible area, which is also its zoomed frame. The function now records Maximized in that case. This is what failed Given_AppWindowTitleBar.When_TitleBar_Hidden_On_MacOS_Presenter_Commands_Work.

The tests: AppKit caps a visible window at the usable height, and fits a window to the whole usable area when it is first shown.

  • Given_AppWindow.When_Resize grew the main test window, which already filled the area, by 10 px. 1034×659 was requested; the width was kept and the height stayed at 649. It now shrinks the window instead.
  • Given_AppWindow.When_Resize_Before_Activate grew a new 1024×768 window to 1034×778. That worked while the window was hidden (the first size check passed), but showing it fitted it back to 1024×649, so the check after Activate() failed. It now resizes to 600×400, which fits any screen.

Re-enabled: the PlatformCondition exclusions on When_Resize and When_Resize_Before_Activate and the [Ignore] on When_TitleBar_Hidden_On_MacOS_Presenter_Commands_Work that #25492 added are removed. Rebased onto master, so this PR's CI runs them on the xcode-27 image itself.

New test: When_Window_Already_Has_Its_Maximized_Frame_Then_Maximize_Reports_Maximized (macOS). It recreates the small-screen case on any display:

  1. Maximize the window and note its frame.
  2. Restore it, then move and resize it back to that frame.
  3. Maximize again, and check that State becomes Maximized.

Validation

On a Mac (macOS 27.0.1, Apple M2, desktop SamplesApp, Skia). To reproduce CI's screen, a 1024×768 virtual display was created with CoreGraphics' CGVirtualDisplay and made the main display.

Build 1024×768 display (like xcode-27) 1920×1080 display
master (b40e235) the 3 tests fail as on CI: both resize size asserts, and the title-bar test times out at line 258 pass
tests only (without the UNOWindow.m fix) Given_AppWindow + Given_AppWindowTitleBar: 19 passed, 2 failed (the title-bar test and the new test) the new test fails, the rest pass
this PR 21 passed, 0 failed, 4 skipped (not macOS) 21 passed, on 2 runs

PR Checklist ✅

🤖 Generated with Claude Code

@github-actions github-actions Bot added the platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform label Oct 27, 2026
@ramezgerges
ramezgerges force-pushed the dev/rara/macos-small-screen-window branch from 4727d88 to a5e7d36 Compare October 27, 2026 01:18
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 241572 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • Buttons.png-dark
    • CalendarView_Theming.png-dark
    • Buttons.png
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DisplayInformation.png-dark
    • DoubleImageBrushInList.png-dark
    • DoubleImageBrushInList.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • DropDownButtonPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • ImageBrushAlignmentXY.png-dark
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedIconPage.png-dark
    • Accessibility_ScreenReader.png-dark
    • AnimatedVisualsTestbedPage.png
    • AppBarButtonWithIconTest.png-dark
    • ApplicationViewSpanningRectsPage.png-dark
    • ApplicationViewMode.png-dark
    • AppWindowPositionAndSize.png-dark
    • AppWindowClosing.png-dark
    • Arrange_Performance01.png-dark
    • AppWindowTitleBar Properties.png-dark
    • Attributed_text_Supserscript.png-dark
    • Arrange_Performance01.png
    • AutoBorderStretchwithleftmargin.png-dark
    • Attributed_text_Supserscript.png
    • AutomationPropertiesExtensions_Role.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutomationProperties_Landmark.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • AutomationProperties_Landmark.png

ramezgerges and others added 2 commits October 27, 2026 14:36
CI's macOS VMs have a 1024x768 display, leaving a 1024x649 usable area once
the menu bar and Dock are taken out. AppKit caps a visible window at that
height and fits a window to the whole area when it is first shown, so:
- When_Resize grew a window that already filled the area, and the height
  stayed at 649; it now shrinks the window instead;
- When_Resize_Before_Activate grew a new 1024x768 window to 1034x778, which
  showing it fitted back to 1024x649; it now resizes to 600x400.

Also covers Maximize on a window that already has its maximized frame.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Maximize skipped zoom: when AppKit said the window was already zoomed, and
only zoom: records the presenter state, so a window that filled a small
screen stayed Restored. It now records Maximized in that case.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@ramezgerges
ramezgerges force-pushed the dev/rara/macos-small-screen-window branch from a5e7d36 to ca84a0c Compare October 27, 2026 18:36
unoplatform#25492 disabled When_Resize, When_Resize_Before_Activate and
When_TitleBar_Hidden_On_MacOS_Presenter_Commands_Work on macOS when CI moved
to the xcode-27 image, whose 1024x649 usable area they did not fit. The
previous two commits fit the resize tests to small screens and report
Maximized for a window that already fills the screen, so they run again.

Fixes unoplatform#25728.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@ramezgerges
ramezgerges enabled auto-merge October 27, 2026 18:36
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

ramezgerges and others added 2 commits October 27, 2026 16:11
When_Window_Resized grew a window that can already fill a small
screen, and left its dialog open as a back-button listener, which
made Given_Flyout.BackButtonIntegration fail after it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Oct 27, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 241770 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • DisplayInformation.png-dark
    • DropDownButtonPage.png-dark
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Image_UseTargetSizeLate.png-dark
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png-dark
    • AnimatedBackVisualSourceSamplePage.png
    • AppBarButtonTest.png-dark
    • AppBarButtonWithIconTest.png-dark
    • AppBarToggleButtonTest.png
    • ApplicationViewSizing.png-dark
    • AppWindowClosing.png-dark
    • AppWindowPositionAndSize.png-dark
    • ArcSegment.png
    • Arrange_Performance01.png-dark
    • AuthenticationBroker_Demo.png
    • AutoBorderStretchwithbottommargin.png-dark
    • AutomationProperties_AutomationId.png
    • AutomationProperties_Landmark.png-dark
    • AutomationProperties_StructureAndProps.png-dark
    • AutomationProperties_StructureAndProps.png
    • BackGesture.png-dark
    • BackGesture.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png

@ramezgerges
ramezgerges merged commit 340f5ef into unoplatform:master Oct 27, 2026
47 checks passed
@ramezgerges
ramezgerges deleted the dev/rara/macos-small-screen-window branch October 27, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[macOS] Fix Window Resizing, Presenter Commands Breakage [macOS] Maximize leaves the presenter Restored when the window already fills the screen

5 participants