(In reply to Emilio Cobos Álvarez (:emilio) from comment #20)
Non-composited X11 (the legacy variant of X11: i3, KDE with manually disabled 
compositor, etc.) does not support transparency. Everything that would usually 
be transparent/alpha is just black/opaque. Menus and window corners had 
[shadows on black 
background](https://bug1479135.bmoattachments.org/attachment.cgi?id=8995686) 
(=fat black borders).
The autoscroll icon was a [black square with a white 
circle](https://bug1649246.bmoattachments.org/attachment.cgi?id=9160184) in it.

[XShapeCombineMask](https://searchfox.org/mozilla-
central/search?q=XShapeCombineMask&path=) is implemented for software
rendering only. Firefox creates a stencil (like a cookie cutter) of
where transparency needs to get cut off. X11 then applies this stencil
on every frame. The outer shadow of a rounded main menu, addon widget or
[window titlebar](https://searchfox.org/mozilla-
central/rev/37373cdeed20695af1ff1fd090f0736d9bf15e65/widget/gtk/nsWindow.cpp#6729,6793)
has transparency, so it gets cut off by X11, leaving a rounded widget
without shadow.

XShapeCombineMask is not implemented for hardware rendering.
That's why SW WR is enforced for menus, addons and autoscroll icon on 
non-composited X11 to make use of XShapeCombineMask while the main window is 
still using OpenGL.

XShapeCombineMask
* caused problems on 
[Mutter](https://searchfox.org/mozilla-central/rev/37373cdeed20695af1ff1fd090f0736d9bf15e65/widget/gtk/nsWindow.cpp#9084)
 back then
* crashes the GPU process on Nvidia: bug 1730991
* causes performance problems according to the Chromium bugtracker: bug 1733094 
comment 18,https://bugs.chromium.org/p/chromium/issues/detail?id=1198080

Could XShapeCombineMask be removed and instead menus and the autoscroll icon 
loose their border-radius (become rectangular) and loose their shadow (to avoid 
black background) if gdk_screen_is_composited() is false?
IIUC, that would reduce code complexity, improve stability and performance.

A rectangular autoscroll icon on non-composited X11 would be noticeable.
But users choose non-composited X11 to get more performance than with
composited X11. Considering this as well, it doesn't make sense to use
XShapeCombineMask which contradicts their intent and causes above
problems.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to firefox in Ubuntu.
https://bugs.launchpad.net/bugs/1871644

Title:
  Top corners of Firefox windows have weird black protrusions from the
  rounded edges

Status in Mozilla Firefox:
  Confirmed
Status in firefox package in Ubuntu:
  Confirmed

Bug description:
  Image to illustrate the problem is attached. All firefox windows on
  Wayland (EDIT: and X11) have a weird black protrusion from the top-
  left and top-right corners where yaru has curved the window corners,
  but something from Firefox appears to not be being clipped by the
  theme. I need to double check whether this appears on X11, but for now
  consider it Wayland only until I report back, although oSoMoN has
  checked their system and they don't see the behaviour (on X11).

  EDIT: I have now checked X11 on my system and I see the same behaviour
  as described above, so this is affecting BOTH Wayland AND X11 for me.

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: firefox 75.0+build3-0ubuntu1
  ProcVersionSignature: Ubuntu 5.4.0-21.25-generic 5.4.27
  Uname: Linux 5.4.0-21-generic x86_64
  NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
  ApportVersion: 2.20.11-0ubuntu25
  Architecture: amd64
  BuildID: 20200403170909
  CurrentDesktop: ubuntu:GNOME
  Date: Wed Apr  8 14:48:56 2020
  InstallationDate: Installed on 2020-03-03 (35 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Alpha amd64 (20200303)
  SourcePackage: firefox
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/firefox/+bug/1871644/+subscriptions


-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to