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

Firefox popups not rendered on some multi-output setups #6147

Closed
emersion opened this issue Mar 30, 2021 · 106 comments
Closed

Firefox popups not rendered on some multi-output setups #6147

emersion opened this issue Mar 30, 2021 · 106 comments
Labels
bug Not working as intended client-compat Compatibility issues with a particular application firefox Related to firefox on wayland

Comments

@emersion
Copy link
Member

emersion commented Mar 30, 2021

  1. Setup one output on the left with scale=1, and one output on the right with scale!=1
  2. Start Firefox with its Wayland backend
  3. From time to time some popups will not be displayed (I think it happens more often with the addon popups when Firefox is displayed on the scale!=1 output). The clicks will still go through just fine.
@emersion emersion added bug Not working as intended client-compat Compatibility issues with a particular application renderer Related to Sway's renderer labels Mar 30, 2021
@emersion emersion added this to the 1.6 milestone Mar 30, 2021
@luispabon
Copy link

I made this recording here to show some weirdness related to this. The laptop display is scale 2, top display scale 1. I have a third scale 1 display to the right.

https://www.youtube.com/watch?v=63nUUXE6Qt0

If I position firefox very close to the bottom edge of the top display, the popup will display.

There's also that weird thing on the bottom display once I move the floating FF window where a chunk of the ff window is rendered and flickers.

I'm on master sway (1d62d6b) and wlroots (b89bcffe)

@emersion
Copy link
Member Author

There's also that weird thing on the bottom display once I move the floating FF window where a chunk of the ff window is rendered and flickers.

Hm, this seems like a separate bug, I've seen this with other clients as well. Can you open a new bug report?

@luispabon
Copy link

luispabon commented Mar 30, 2021

Of course.
Edit: flickering weirdness here #6148

@minhduc0711
Copy link

This might be related https://bugzilla.mozilla.org/show_bug.cgi?id=1684197.
In my case, the popups don't show up on the monitor with scale == 1.

@emersion
Copy link
Member Author

emersion commented Mar 31, 2021

Is the scale=1 monitor on the right in your setup?

@luispabon
Copy link

luispabon commented Mar 31, 2021

Yes. Top and top right scale 1, bottom scale 2

{
    output eDP-1 mode 3840x2160 scale 2 position 0,1081
    output "Iiyama North America PL2410HD 11046A0B03094" mode 1920x1080 scale 1 position 0,0
    output "Samsung Electric Company SMB1920NW HMDB101546" mode 1440x900 scale 1 position 1920,0
}
  • Extension popups don't display on the scale 1 displays but do on the scale 2 display on this config
  • If I switch the scale 1 displays to scale 2, the extension popups display on them
  • If I switch eDP-1 to scale 1, the extension popups also display

@kennylevinsen
Copy link
Member

Does anyone have a reproduction on another compositor?

@luispabon
Copy link

I've just checked on Wayfire and the issue does not happen there.

@luispabon
Copy link

Neither does it happen in gnome 3.38.

@emersion
Copy link
Member Author

This doesn't seem to be a damage tracking related issue, because I can still reproduce it with -Ddamage=rerender.

@emersion
Copy link
Member Author

Additional note: the coords in xdg_popup.configure seem to be reasonable. So probably something completely stops the popup (or a subsurface) from being rendered.

@luispabon
Copy link

luispabon commented Mar 31, 2021

The menu is definitely open since you can click on it. See recording and keep an eye on the shield (ublock extension) icon:

recording.mp4

@minhduc0711
Copy link

@luispabon Yup I noticed this as well! Apparently they are just invisible.

@kennylevinsen
Copy link
Member

The surface structure when it succeeds:
screenshot-success

The surface structure when it fails:

screenshot-failed

The subsurface characteristic to firefox is missing from the popup in the blank case. There's also only 1 frame callback requested and fired on the xdg_popup in the failure case, and two in the success case.

An additional observation is that, when reproducing with our Wayland backend, toggling fullscreen for our window while the subsurface is missing will lead to it showing up.

@cherti
Copy link
Contributor

cherti commented Apr 4, 2021

Also observing probably this with a <1 scaled display on the right and a >1 scaled display on the left and they are primarily showing up on the unscaled monitor, but I have observed it on one of the scaled ones as well, although subjectively it's rarer there.

If that helps anything with debugging.

@RicArch97
Copy link
Contributor

I can confirm this issue with the menus not showing up.

My setup:

output HDMI-A-1 {
        scale 1.5
        pos 0 0 mode 3840x2160@60Hz
}

output DP-2 {
        pos 2560 0 mode 3440x1440@144Hz
}

Pop-ups do not show up on HDMI-A-1, but DO show up on DP-2. Toggling full screen on HDMI-A-1 after clicking the popup button makes it appear.

@kennylevinsen
Copy link
Member

I suspect this is a Firefox issue, but I wouldn't mind being proven wrong.

We don't need additional confirmations of the bug. The only thing that would be interesting is if someone has a vastly different reproduction case - e.g., only 1 monitor, or using scale 1 on all outputs. We already know that 2 outputs with different scale settings reproduce the issue.

@ainmosni
Copy link

ainmosni commented Apr 7, 2021

I have this same problem with this setup:

output eDP-1 resolution 3840x2160 position 0,0 scale 2
output DP-1 resolution 2560x1440 position 1920,0 scale 1
output DP-2 resolution 1920x1080 position 4480,0

The select elements/extension menus work on eDP-1, but not on DP-1 or DP-2.

GNOME 3.38 on wayland doesn't have this problem.

I'm running Firefox 87.0 on sway 1.5.1 with wlroots 0.12.0 on Arch.

@emersion emersion removed this from the 1.6 milestone Apr 7, 2021
@Synthetica9
Copy link
Contributor

Is this also related to firefox freezing on such a setup? I've had consistent problems with my mixed-scale setup, with hard freezes every few hours and "soft freezes" constantly (image updates only when giving input like moving the mouse, annoying when watching video for example). I then used my laptop standalone without an external monitor over the weekend, and these issues vanished.

@emersion
Copy link
Member Author

emersion commented Apr 7, 2021

Sounds like a separate issue.

@ainmosni
Copy link

ainmosni commented Apr 7, 2021

@emersion seems likely but I've had those problems as well, especially when doing anything video related. Just adding that for completeness of information's sake, haven't been able to verify if this is specific to firefox under sway of just a firefox bug.

@ainmosni
Copy link

ainmosni commented Apr 7, 2021

This also affects drop downs in web pages.

@pinselimo
Copy link
Contributor

I'm experiencing flickering of especially drop downs in web pages using only 1 display:

output eDP-1 {
     resolution 2560x1440
     scale 1.42
 }

Doesn't happen on Gnome 3.38. Firefox 87.0, Sway 1.5.1, wlroots 0.12.0
Also happened on Sway 1.5 / wlroots 0.11.0
Seems to disappear on Sway 1.6 / wlroots 0.13.0 (although using Ubuntu I reverted to using wayland-server 1.18)

@emersion
Copy link
Member Author

emersion commented Apr 8, 2021

Flickering is unrelated to this issue and fixed in 1.6.

@pkupper
Copy link

pkupper commented Apr 11, 2021

I'm experiencing the same issue with the following configuration.

output DP-1 resolution 3840x2160 position 1920,0 scale 1.5
output HDMI-A-1 resolution 1920x1080 position 0,360

@nayaabkhan

This comment has been minimized.

@rpigott
Copy link
Member

rpigott commented Sep 22, 2021

@nayaabkhan That's #6426.

@cherti
Copy link
Contributor

cherti commented Sep 22, 2021

Ok, I think I've identified the issue I observed: if the context menu doesn't appear right away on right click, it is actually invisible, but becomes visible once the mouse hovers over it. So moving the mouse around when observing the problem makes the context menu pop up. Just to double check: This is unrelated to the issue here and is a separate bug, right?

(The according log if anyone wants to double check: firefox-invisible-context-menu.txt)

@stransky
Copy link

Ok, I think I've identified the issue I observed: if the context menu doesn't appear right away on right click, it is actually invisible, but becomes visible once the mouse hovers over it. So moving the mouse around when observing the problem makes the context menu pop up. Just to double check: This is unrelated to the issue here and is a separate bug, right?

(The according log if anyone wants to double check: firefox-invisible-context-menu.txt)

It looks like the popup is not rendered on Firefox side. Please open a new bug at bugzilla.mozilla.org
Thanks.

@cherti
Copy link
Contributor

cherti commented Sep 23, 2021

Alright, thank you for taking a look, I'll make sure to open a bug over there. :)

@Epse

This comment has been minimized.

@ronchaine

This comment has been minimized.

@rpigott
Copy link
Member

rpigott commented Oct 10, 2021

If you don't have 2 or more displays with different scales, you're in the wrong place. This bug is already fixed here #6147 (comment), just waiting for review and then it can be closed.

If you have only one output and you have issues at >1 scale, that's #6426 and you only need the first patch.

If you have anything else, or if you can still reproduce your popup issue on nightly after applying the gtk patches, report it to firefox.

@tobiasjakobi
Copy link

@cherti Did you already open a bug over at the Mozilla tracker? I'm on Firefox 93.0, scaling is 1.0 with just one display, and I still see this issue (probably started when I upgraded to Firefox 91.0).

@cherti
Copy link
Contributor

cherti commented Oct 10, 2021

@tobiasjakobi I did, this one, but I cannot reproduce the issue anymore with nightly (or what was nightly at the time, should now be beta, I think), hence we closed this for now. I in fact cannot currently reproduce the issue on Firefox 93 already for quite some time now, so I consider the bug I ran into fixed for now. Yours might be a different one, and given that you use only one display and no scaling it wouldn't be too surprising if your bug is unrelated to the current discussions, as the common denominator of all reports in here was a scaling != 1 on one of the displays involved.

@valkum
Copy link

valkum commented Oct 11, 2021

I have a similar problem for the Media Permissions Popup in Firefox 93. The addons popup seem to work. In 1% of cases the Media Permissions popup renders correctly in 99% of the cases, it fails to render but the elements are clickable. I have these problems with dpi=1 on all displays but also with one display set to dpi=1.5.

I opened https://bugzilla.mozilla.org/show_bug.cgi?id=1735137 to track this.

@tobiasjakobi
Copy link

tobiasjakobi commented Oct 16, 2021

@cherti Thanks, I also did some tests with nightly and beta builds in the past days. I think I've isolated the problem to a Firefox config variable which I modified: layout.css.devPixelsPerPx

I've set it to 1.1 some time ago, since I find it easier on the eyes. The issue does not appear when resetting the value to it's default.

Once setting it to 1.1 the issue appears in the beta builds, and also in nightly. Does not matter.

Here's a screenshot illustrating the sandwich menu not showing up:
screenshot_2021-10-16-163957

I made two interesting observations here. First of all by rearranging the windows, I can get menu to render properly:
screenshot_2021-10-16-164017

So maybe FF does place the menu surface somewhere where it shouldn't?

The second observation is that after opening the (non-showing) menu, switching to next window, switching back to the FF window, repeating, I can trigger FF exiting due to a Wayland error:

./firefox -ProfileManager -no-remote 

###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost

Gdk-Message: 16:38:42.612: Lost connection to Wayland compositor.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.

Needless to say, switching to the X11 backend (MOZ_ENABLE_WAYLAND=0) makes the issue go away.

@cherti
Copy link
Contributor

cherti commented Oct 16, 2021

@tobiasjakobi can confirm, changed that option as well and I do see the issue as well. have you opened a bug report in the mozilla bug tracker?

@akay
Copy link

akay commented Oct 17, 2021

I think I've isolated the problem to a Firefox config variable which I modified: layout.css.devPixelsPerPx

Yep, I had it at 1.125 and resetting this to its default value fixes it for me too.

@rpigott
Copy link
Member

rpigott commented Oct 21, 2021

Resolved by gtk!3941 + gtk!3944.

@rpigott rpigott closed this as completed Oct 21, 2021
@noahtallen
Copy link

My gtk3 version is up-to-date on arch, but I still seem to be having this issue with MOZ_ENABLE_WAYLAND=1. If I use MOZ_ENABLE_WAYLAND=0, dropdowns work fine. Is that expected?

@ojab
Copy link

ojab commented Nov 18, 2021

up-to-date arch tells nothing about installed gtk3 version and fixes are not in the released gtk3 yet.

@noahtallen
Copy link

noahtallen commented Nov 18, 2021

Fair! I saw in gitlab that it was merged to gtk-3-24. The gtk package I have is gtk3-1:3.24.30+90+g20be04f7ac-1, so I assumed that mapped to 3.24. (Plus, the commit in gitlab was a month older than the most recent update to the gtk package on arch.)

If it's not released yet, that would explain it :)

@ojab
Copy link

ojab commented Nov 18, 2021

hmm, both PRs mentioned above are included into 20be04f7ac4a2081ce34768397873b7551e17c69 though /shrug
I guess retest on firefox nightly+sway/wlroots main and maybe create another issue.

@noahtallen
Copy link

noahtallen commented Nov 19, 2021

It appears to be fixed in firefox nightly (96.0a1), but not in 94.0.2 (Unless it's some sort of config difference, but it's also broken in private windows.) I verified both are running wayland under window protocol in about:support. Edit: also fixed in developer edition (95.0b8)

@minhduc0711
Copy link

minhduc0711 commented Nov 20, 2021

I also use arch and have the same gtk3-1:3.24.30+90+g20be04f7ac-1 package. After the fixes, popups are working fine for me on Firefox 94.0.2 so I think your issue might be a new one.

@m0ppers
Copy link

m0ppers commented Feb 2, 2022

Am I the only one who still has these problems? Sway 1.7 on arch linux + Firefox 96 when I join an audio session in discord the media popup is invisible most of the time. My only workaround so far is exiting and restarting sway. then I am not doing anything except starting firefox and going to discord. then the media popup asking for mic permissions is finally popping up and everything is working. As soon as I start doing something - switching workspaces, starting some apps - the popup fails to render.

@luispabon
Copy link

Do you have the latest gtk 3? I believe the fixes went in on 3.24.31

@m0ppers
Copy link

m0ppers commented Feb 2, 2022

extra/gtk3 1:3.24.31-1 [installed]
    GObject-based multi-platform GUI toolkit

:|

@ojab
Copy link

ojab commented Feb 2, 2022

@Ghosthree3
Copy link

Ghosthree3 commented Feb 5, 2022

Am I the only one who still has these problems? Sway 1.7 on arch linux + Firefox 96 when I join an audio session in discord the media popup is invisible most of the time. My only workaround so far is exiting and restarting sway. then I am not doing anything except starting firefox and going to discord. then the media popup asking for mic permissions is finally popping up and everything is working. As soon as I start doing something - switching workspaces, starting some apps - the popup fails to render.

I definitely still have this issue, I'm completely unable to install addons under wayland at the moment. I don't scale outputs at all either.

EDIT: Seems to have been fixed with wlroots 0.15.1.

@rpigott
Copy link
Member

rpigott commented Feb 7, 2022

This issue is resolved. If you have an issue, even a similar one, make a new topic and describe it in detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended client-compat Compatibility issues with a particular application firefox Related to firefox on wayland
Development

No branches or pull requests