Skip to content

macOS: square-cornered borderless windows (SetCornerPreference unsupported, frameless keeps rounded corners) #83

Done

Description

@lijy91

Problem

A full-display overlay needs square corners and no window chrome. On macOS:

  • SetFrameless(true) keeps NSWindowStyleMaskTitled (a hidden title bar with full-size content), so the window keeps macOS's rounded corners. At the corners of a display-sized overlay the desktop shows through.
  • SetCornerPreference() is documented as ❌ on macOS and always returns false.

The Flutter screen-capture example (PR #75) works around it in MainFlutterWindow.swift: it switches styleMask to .borderless while the overlay is shown and restores the saved mask afterwards. It also overrides canBecomeKey / canBecomeMain; nativeapi already overrides canBecomeKeyWindow, so that override may be redundant once the window really is borderless. Please verify.

Proposal

Support WindowCornerPreference::DoNotRound on macOS, or a borderless frameless mode (styleMask = NSWindowStyleMaskBorderless) that still accepts key focus and keyboard input. When the preference returns to Default, restore the previous style mask.

Acceptance

From Dart only, a frameless window sized to a display has square corners on macOS and still receives key events (Esc / Enter).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions