Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(catalyst): Fix content behind titlebar #1517

Merged
merged 1 commit into from
Dec 25, 2024

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Dec 22, 2024

Platforms affected

macOS Catalyst

Motivation and Context

Closes GH-1491.

Description

When showing a webview on macOS Catalyst, always position it below the titlebar when a titlebar is displayed. This has the side effect of making all the safe-area-inset values 0, regardless of the viewport-fit value.

Also adds a HideDesktopTitlebar preference to make the titlebar invisible on macOS Catalyst with content extending behind it. I named this in a generic way because it sounds like this should also be feasible to apply to the cordova-electron platform.

When using a preference to disable drawing the titlebar, safe-area-inset works as expected (but generally requires viewport-fit=cover to be specified).

Testing

Tested with viewport-fit=cover and viewport-fit=contain and measured the calculated safe-area-inset-top value.

Checklist

  • I've run the tests to see all new and existing tests pass
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@dpogue dpogue added this to the 8.0.0 milestone Dec 22, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.84%. Comparing base (3737f51) to head (8e93a08).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1517   +/-   ##
=======================================
  Coverage   80.84%   80.84%           
=======================================
  Files          16       16           
  Lines        1848     1848           
=======================================
  Hits         1494     1494           
  Misses        354      354           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Tested building app with the flag set to true and false, view-port set to contain and cover, and with and without the safe-area's defined.

@dpogue dpogue merged commit 538fe8e into apache:master Dec 25, 2024
11 checks passed
@dpogue dpogue deleted the catalyst-titlebar branch December 25, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The macOS statusbar overlays the web view on Mac Catalyst
3 participants