rafaelmardojai / firefox-gnome-theme

A GNOME👣 theme for Firefox🔥
The Unlicense
3.4k stars 155 forks source link

[wayland] Right-click menu rendering glitch when right-clicking on images & videos #720

Closed rien333 closed 8 months ago

rien333 commented 8 months ago

Describe the bug The right-click menu renders "oddly" whenever I right-click on an image or video (and perhaps more web elements). Specifically, it appears to not scale well, such that 1) text appears "squished", and 2) the highlighted menu options does not align with where my cursor actually is. Rather, the highlighted menu option is always above where my mouse cursor currently resides. (recording attached below)

I can consistently reproduce this on image and video elements (such as the screen recording I've attached), but I'm pretty sure I've triggered this bugged context menu when clicking on other elements. For example, at the moment, I can trigger it reliably when I right-click on misspelled words!

Thanks for the excellent theme btw!

To Reproduce

  1. Launch firefox using MOZ_ENABLE_WAYLAND=1 firefox
  2. Go to firefox-gnome-theme on github
  3. Right-click on the project logo or any other image.

Expected behavior The right-click menu (or context menu, as it's sometimes called) should look and function the same, regardless of what kind of web element I click on.

Screenshots

Screencast from 2023-12-14 15-30-01.webm

Setup information

Additional context

  1. I'm running firefox in pure wayland mode, if that matters (i.e. I have MOZ_ENABLE_WAYLAND=1 set in ~/.config/environment.d/vars.conf).

  2. I cannot reproduce if I start firefox with --safe-mode --profile /tmp/firefox-profile/. (which should disable the gnome theme)

zbikk commented 8 months ago

can't replicate, works fine for me

rien333 commented 8 months ago

can't replicate, works fine for me

Bummer! Are you running firefox in wayland mode as well? I just launched firefox using MOZ_ENABLE_WAYLAND=0 firefox, and in that case, I also cannot reproduce. So, the problem seems to be related to MOZ_ENABLE_WAYLAND=1.

I've updated the title of my issue to reflect this finding.

rafaelmardojai commented 8 months ago

I'm using Firefox Flatpak with Wayland and can't reproduce.

rien333 commented 8 months ago

I'm using Firefox Flatpak with Wayland and can't reproduce.

Running firefox in a wayland environment/DE is not the same as running firefox itself in wayland mode. By default, firefox will always run as an xwayland application, unless you set MOZ_ENABLE_WAYLAND to 1. (this behavior is likely to change in future as wayland adaption grows)

So, the real question is what kind of value for MOZ_ENABLE_WAYLAND you (@rafaelmardojai ) are using, and whether that gets picked up by flatpak (for flatpak instructions, see this link).

From the arch wiki:

More recent versions of Firefox support opting into Wayland mode via an environment variable.

 $ MOZ_ENABLE_WAYLAND=1 firefox
rafaelmardojai commented 8 months ago

@rien333 I'm not using that env var but I have removed the x11 permission from the Flatpak, and about:support states wayland as the window protocol.

But I can try setting the env var.

rafaelmardojai commented 8 months ago

I still can't reproduce with the env var set.

rien333 commented 8 months ago

Hm, if you are 100% sure that your flatpakked firefox is not using xorg (you can check this with xprop), then let me try with the flatpak version as well.

rafaelmardojai commented 8 months ago

Yeah I'm sure, the flatpak without x11 nor fallback-x11 permissions would simply crash because it doesn't has ways to display.

Tried xprop and I can't target the Firefox window, so effectively it's Wayland.

pol5xc commented 8 months ago

I'm not sure if it is helpful but I was having a this same issues and in my case it seems like setting widget.wayland.fractional-scale.enabled to false might have fixed it.

rien333 commented 8 months ago

setting widget.wayland.fractional-scale.enabled to false might have fixed it.

This worked!! Thank you so much for pointing this out ☺️

Sorry for the noise, but I guess we learned something.