Closed Bug 1672591 Opened 4 years ago Closed 4 years ago

[fractional scaling] main menu do not fit screen size under fractional scaling (gnome/wayland)

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 82
defect

Tracking

()

RESOLVED DUPLICATE of bug 1589970
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: crab2313, Assigned: filip.hejsek)

References

(Blocks 1 open bug)

Details

Attachments

(7 files)

Attached image Screenshot

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

desktop environment: gnome 3.38 with fractional scaling enabled (125%)

Start firefox with MOZ_ENABLE_WAYLAND=1 and open the main menu.

Actual results:

The main menu do not fit the whole screen and have a scrollbar.

Expected results:

The main menu should not use a scrollbar since the screen is large enough to display the entire menu.

Hi crab2313,

Thanks for reporting this bug.

I don't have that specific configuration but I'll go ahead and add a product and component so the corresponding team can investigate.

In the meantime, can you download Firefox Nightly and see if the issue is reproducible there as well? You can download it from here: https://nightly.mozilla.org

Regards,
Virginia

Component: Untriaged → Widget: Gtk
Flags: needinfo?(crab2313)
Product: Firefox → Core

(In reply to Virginia Balducci from comment #2)

Hi crab2313,

Thanks for reporting this bug.

I don't have that specific configuration but I'll go ahead and add a product and component so the corresponding team can investigate.

In the meantime, can you download Firefox Nightly and see if the issue is reproducible there as well? You can download it from here: https://nightly.mozilla.org

Regards,
Virginia

The latest nightly version still has the issue.

Flags: needinfo?(crab2313)

ping!
I think UI related issues should belong to the Firefox product.

Summary: main menu do not fit screen size under fractional scaling (gnome/wayland) → [fractional scaling] main menu do not fit screen size under fractional scaling (gnome/wayland)

Can you please test latest nightly under Wayland? A new popup handling code landed there.
Thanks.

The bookmark popup can now be scrolled, so the buttons are accessible, but the size is still too small (version 91.0a1 20210601213358).

Attached image Menu popup in nightly

The menu popup is also too small

Problem also appears in KDE Plasma (Wayland).
Additional info:
gfx.monitors resolution is 3072x1728 (from telemetry)
In the browser toolbox, size of the screen is 1536x824 (check size of browser's <body> container)
Actual resolution is 1920x1080 with 125% screen scale.

A reported resolution of 3072x1728 is expected, fractional scaling in Wayland is implemented by rendering at 2x scale and downscaling the resulting buffer (this is a limitation of the protocol, although there is some ongoing work to improve that).

The problem here seems to be that some code responsible for ensuring popups fit into the screen doesn't take into account the scaling factor (or maybe applies it twice). The result is that popups use only half of the available screen space. I think the problem is somewhere in nsWindow.cpp (https://searchfox.org/mozilla-central/source/widget/gtk/nsWindow.cpp), but i didn't yet have time to set up Firefox build environment and debug the problem.

Assignee: nobody → filip.hejsek

I have found that GetScreenRect returns the screen size from gdk without conversion, but the size is then interpreted as device pixels, so i created a patch which fixes that. After this change, the bookmark popup and the context menu have the right size, but the app menu is still too small, so there must be something else causing that.

Pushed by stransky@redhat.com: https://hg.mozilla.org/integration/autoland/rev/ad80e7dc4ca9 Convert workarea to device pixels in GetScreenRect. r=stransky
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch

This bug is not yet fixed by the patch above, right?

If this commit is already in a fresh build, then the problem has not been resolved yet.

This bug is a duplicate of bug 1589970. That bug has a patch which attempts pretty much the same solution, but had to be discarded because it breaks non-fractional-scaling mode.

Whether the monitor units are in device pixels or "logical" pixels depends on mutter's scale-monitor-framebuffer setting. So the monitor sizes are no use at all.

See the discussion in https://gitlab.gnome.org/GNOME/mutter/merge_requests/510: GdkMonitor cannot be used to size windows on Wayland because you can't know what the units are, even if you knew which monitor your surface is going to be placed on.

Attempting to use workarea at all is an exercise in futility.

This patch should be backed out.

Resolution: FIXED → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: