Skip to content

[macOS] AppWindow.Position and Move use a bottom-left origin, so Y is inverted #25650

Closed

Description

@ramezgerges

Current behavior 🐛

On the macOS desktop host, AppWindow.Position and AppWindow.Move use AppKit's frame origin as-is: the window's bottom-left corner, with Y measured upward from the bottom of the screen. Increasing Y therefore moves the window up.

Measured on macOS 27.0.1 (1920x1080) with the window bounds reported by CGWindowListCopyWindowInfo (top-left origin, Y down, the same convention as WinUI):

AppWindow.Position Window top-left on screen
Before Move (0, 90) (0, 194)
After Move(new PointInt32(10, 100)) (10, 100) (10, 184)

The window moved up 10px. Position.Y is 1080 - 194 - 796 (window height) = 90, the distance from the bottom of the screen to the bottom of the window. Likewise, Move(new PointInt32(40, 40)) places a window 40px above the bottom of the screen.

Given_AppWindow.When_Move cannot catch this because it reads back the same unflipped value it set. It only fails when the window is already at the top of the screen: AppKit then refuses to move the title bar under the menu bar, so the position does not change (seen on the small display of the macOS 27 CI agents).

Expected behavior 🎯

As in WinUI, AppWindow.Position is the window's top-left corner in screen coordinates with Y growing downward, and Move with a larger Y moves the window down.

How to reproduce it (as minimally and precisely as possible) 🔬

  1. On the macOS desktop target, read appWindow.Position.
  2. Call appWindow.Move(new PointInt32(p.X, p.Y + 100)).
  3. The window moves up by 100 instead of down.

Workaround 🛠️

None.

Affected platforms 📱💻🖥️

Desktop (macOS)

Uno.Sdk version (and other relevant versions) 📦

master (src/Uno.UI.Runtime.MacOS/UnoNativeMac/UnoNativeMac/UNOWindow.m: uno_window_move, uno_window_get_position, windowDidMove).

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

uno_window_convert_local_to_screen in the same file already flips Y against the primary screen, so ConvertLocalToScreen and AppWindow.Position currently disagree.

Found while investigating the macOS failures of #25492.

Activity

  1. added
    triage/untriaged
    on Oct 22, 2026
  2. added a commit that references this issue on Oct 26, 2026
    1f92c16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions