Skip to content

fix: extension popup panel height on fractional scaling#13607

Open
shelldandy wants to merge 2 commits into
zen-browser:devfrom
shelldandy:fix/extensions-scale-v2
Open

fix: extension popup panel height on fractional scaling#13607
shelldandy wants to merge 2 commits into
zen-browser:devfrom
shelldandy:fix/extensions-scale-v2

Conversation

@shelldandy
Copy link
Copy Markdown

@shelldandy shelldandy commented May 7, 2026

Closes #13518

After:
image

Before:
Image

shelldandy added 2 commits May 7, 2026 13:31
Browser-action extension popups (which use `ViewPopup` with
`fixedWidth=false`) rely on `viewNode.customRectGetter` to tell
panelmultiview how tall the subview should be:

    this.viewNode.customRectGetter = () => {
      return { height: this.lastCalculatedInViewHeight || this.viewHeight };
    };

`resizeBrowser` already updates `lastCalculatedInViewHeight` in the
`fixedWidth=true` branch but forgets to do it in the `fixedWidth=false`
branch (which is what `browser_action` popups always use). As a result
`customRectGetter` keeps returning the stale `viewHeight` that was
captured once during `attach()` from
`viewNode.getBoundingClientRect().height`.

On Wayland compositors with fractional scaling (e.g. Hyprland), and
especially in single-toolbar layouts where the panelview is reparented
into a freshly created `customizationui-widget-panel`, that one-shot
measurement can land on an inflated value before the popup HTML reports
its real intrinsic size. The inner `<browser>` ends up sized correctly,
but the surrounding panel stays locked to the inflated height — which
shows up to the user as a small popup floating in a tall, mostly-empty
panel, with the bottom of the popup unclickable.

Mirror the existing `fixedWidth=true` update in the `else` branch so
`customRectGetter` always reports the up-to-date popup height and
panelmultiview lets the panel shrink to fit.

Ships as a temporary external Firefox patch under
`src/external-patches/firefox/` until it lands upstream in Mozilla.
@shelldandy shelldandy requested a review from mr-cheffy as a code owner May 7, 2026 23:53
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. Bug labels May 7, 2026
@mr-cheffy
Copy link
Copy Markdown
Member

please use npm run export a file inside the engine dir to export a valid patch file. Also, it seems to be done on purpose to not set this variable in this branch: https://bugzilla.mozilla.org/show_bug.cgi?id=1403466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extensions spills out of the window, broken scaling on extension popup when opened by mouse clicks

2 participants