gala icon indicating copy to clipboard operation
gala copied to clipboard

Context and drop-down menus cause weird graphical artifacts (shadows remain on screen)

Open ywarnecke opened this issue 4 years ago • 31 comments

I just recently installed elementaryOS again and I really like it. It feels like feels like a perfect mixture between appearance and workflow.

However I noticed a bug with the menus in elementaryOS. If a context menu or drop down menu is opened and then closed again, a part of the shadow will remain on screen. This is not limited to one artifact at a time and is especially apparent in LibreOffice, where the Shadow will flash with the text-position cursor.

Bildschirmfoto von 2019-09-02 08-07-21

This is my current System with two displays:

Bildschirmfoto von 2019-09-02 08-16-57

I am using the newest NVIDIA Drivers (nvidia-driver-430).

ywarnecke avatar Sep 02 '19 06:09 ywarnecke

I'm also seeing this issue, but I thought it was Firefox. Do you have "ui.context_menus.after_mouseup" set to "true" in Firefox's about:config?

I also have a Nvidia card (nouveau drivers).

Blast-City avatar Sep 02 '19 15:09 Blast-City

I have had the same bug in elementary's Files app sometime ago on Fedora 30, but after update gala to latest git snapshot I don't see this anymore (I hope). I'm not using LibreOffice or Firefox but I will install them and try to reproduce.

marlock9 avatar Sep 03 '19 10:09 marlock9

I've noticed this often in NixOS, using gala 50694796d4c8f0ca92517d5a628b0efdf748279c. I'll see if updating to mutter to the tip of gnome-3-28 branch changes anything, and it can still be reproduced.

(could be a regression from https://github.com/elementary/gala/pull/179 maybe?)

worldofpeace avatar Sep 03 '19 13:09 worldofpeace

Okay, I've tested Firefox and I have this bug. gala a790d2d.

marlock9 avatar Sep 04 '19 06:09 marlock9

Upon further inspection it only seems to happen with non-system menus (e.g. Firefox uses its own context menu). With Epiphany or elementary's file explorer there are no problems at all.

ywarnecke avatar Sep 04 '19 17:09 ywarnecke

I have the same problem too. Libreoffice and Firefox. Unlike others, I am using a lenovo g400s laptop with intel hd 4000. The packages that are installed are the default Elementary OS mesa-driver. The installation has not been modified in any way.

ghost avatar Sep 05 '19 05:09 ghost

I'd like to note if you don't have any further detail to account than "me too", the thumbs up feature should be adequate.

worldofpeace avatar Sep 05 '19 22:09 worldofpeace

Duplicate of https://github.com/elementary/os/issues/214

gre0j avatar Sep 08 '19 10:09 gre0j

What was version change in the updated mutter packages? Since it appears to be tied to this it's most likely a regression that could possibly be fixed in gala (assuming).

worldofpeace avatar Sep 08 '19 10:09 worldofpeace

What was version change in the updated mutter packages? Since it appears to be tied to this it's most likely a regression that could possibly be fixed in gala (assuming).

I did a new installation after my bug report and then i blocked the update of libmutter-2-0 from 3.28.3-2~ubuntu18.04.1+elementary3~ubuntu5.0.1 to 3.28.4-0ubuntu18.04.1+elementary4~ubuntu5.0.1 with synaptic.

Sidenote: This prevents an update of gala too, but with the older mutter-package i do not have any artifacts.

Bildschirmfoto von 2019-09-08 12-23-22

gre0j avatar Sep 08 '19 10:09 gre0j

I downgraded mutter to 3.28.2 in NixOS and the issue is gone. Seems to be a regression for gala when using 3.28.4 :+1:

worldofpeace avatar Sep 15 '19 22:09 worldofpeace

Found upstream bug report

  • https://gitlab.gnome.org/GNOME/mutter/issues/536

They identified the bad commit as

  • https://gitlab.gnome.org/GNOME/mutter/commit/527f6ef8357f614793035a999ec4409ef02470e2

I also ran git bisect with mutter and gala on NixOS and identified the same commit.

So what elementary OS could do is patch mutter by reverting the aforementioned commit.

Edit: it appears budgie decided to do this though I tried it with gala to no avail.

worldofpeace avatar Sep 15 '19 23:09 worldofpeace

We use the following patch in NixOS for this.

Someone could PR against https://github.com/elementary/os-patches/tree/mutter-bionic-patched if they'd like the patch there as well.

worldofpeace avatar Sep 16 '19 00:09 worldofpeace

Moved from duplicate issue

This bug seems to have been prevelant for a long time and I've been unsure whether to report it since I'm not sure if it's a problem on the elementary side.

What Happened

On Mesa systems, it seems to be a common bug for Gala to continue to render the backdrops and outlines of overlay menus when they are drawn directly over the desktop, over Gtk apps (or in the case of WebKitGtk, only over header bars). This is observed with overlays such as Gtk context menus, firefox's context menus and shadows, and also certan qt menus. I have observed this only with Gala, and with both Mesa and NVidia's drivers.

Expected Behavior

Much like the GNOME compsitor Mutter (which Gala is based on), there should be no part of the UX that displays such artifacts.

Steps to Reproduce

Example 1:

  1. Open a new workspace, and do not allow for Gala to re-draw the center of the screen (by opening a window, changing workspace etc)
  2. Right click on the center of the screen
  3. Hover over a few items, and then click off the menu
  4. You should be able to observe the line east side of the menu either remaining there, or flickering as you do things outside the bugged area

Video for referance: https://user-images.githubusercontent.com/58219504/103150255-3e2a5800-476a-11eb-9c24-ee9fe485adfe.mp4

Example 2:

  1. Open evolution, or any app with a WebKitGtk view, and position it's window so it's context menu is either over plank and/or the desktop
  2. Open a context menu close to the edge of the window
  3. Observe the context menu's artifacts left behind

Video for referance: https://user-images.githubusercontent.com/58219504/103150259-4edace00-476a-11eb-81cc-1650defe80f6.mp4

Example 3:

  1. Open Firefox and position it's window with enough space on the desktop so that there is enough room for the context menu to render over the destkop
  2. Open a context menu either from the titlebar or the browser contents
  3. Observe the artifacting of the context menus over the firefox window, plank and/or the desktop

Video for referance: https://user-images.githubusercontent.com/58219504/103150269-6619bb80-476a-11eb-9df2-9c20d8467581.mp4

Logs

None that indicate anything abnormal: Screenshot from 2020-12-26 11-14-03

Platform Information

elementary OS 6 Daily Tested on Lenovo ThinkPad X240 with an i5-4300U CPU and Intel® HD Graphics 4400 (Used with default Mesa)

hanaral avatar Dec 27 '20 18:12 hanaral

Can someone working on Gala please have a look at this? All the hardware I've tried experiences this issue with Gala and the problem persists both in elementary Hera and in the Odin dailies. @tintou @jeremypw

hanaral avatar Feb 16 '21 15:02 hanaral

I thought we already come to a conclusion that this was a mutter bug? Tried to make some noise on the mutter issue https://gitlab.gnome.org/GNOME/mutter/-/issues/536#note_724806 but it didn't seem to draw attention. I did also mention that budgie has had the same issue and they have code to workaround it, so maybe we could hack around it in gala, or patch mutter in the elementary distribution. The final option is find someone willing to figure out the issue in mutter. In nixos we hold this patch https://github.com/NixOS/nixpkgs/blob/master/pkgs/desktops/gnome-3/core/mutter/3.34/0003-Fix-glitches-in-gala.patch.

worldofpeace avatar Feb 16 '21 21:02 worldofpeace

@worldofpeace thanks :100: to your patch, Pantheon on Fedora 34+ will not have those glitches - I applied it to the mutter 3.38 compat package since there's no movement at all about this in GNOME upstream ...

decathorpe avatar Mar 11 '21 14:03 decathorpe

This is still present in current 6.0 daily build. Builded mutter from source with mentioned patch applied fixes the issue.

yellowgh0st avatar Mar 21 '21 18:03 yellowgh0st

What could be the appropriate way to implement this patch into elementary OS? Could It be custom mutter binary package which would override the stock one?

yellowgh0st avatar Mar 21 '21 18:03 yellowgh0st

@worldofpeace thanks 100 to your patch, Pantheon on Fedora 34+ will not have those glitches - I applied it to the mutter 3.38 compat package since there's no movement at all about this in GNOME upstream ...

np @decathorpe :100:, I've been using it for sooo long at this point. It seems for downstream use of Pantheon our best solution is to keep a fork of Mutter, which I understand since Mutter upstream creates a new (better) wheel every release.

What could be the appropriate way to implement this patch into elementary OS? Could It be custom mutter binary package which would override the stock one?

@yellowgh0st I've opened an issue at https://github.com/elementary/os-patches/issues/80 If you look at the readme it should hopefully be a straightforward process.

worldofpeace avatar Mar 22 '21 13:03 worldofpeace

I have the same problem when using the pantheon session on Archlinux, but the patch provided by @worldofpeace does not solve the problem.

Zbergen-cli avatar Mar 25 '21 00:03 Zbergen-cli

@Zbergen-cli Which mutter version? It's also plausible in your case for it to be a graphics card related issue

worldofpeace avatar Mar 25 '21 11:03 worldofpeace

@worldofpeace, mutter 3.38.4-2, intel video card. Artifacts can only be seen in the pantheon session.

Zbergen-cli avatar Mar 25 '21 11:03 Zbergen-cli

@worldofpeace Would you be able to provide a precompiled tarball? I don't have the space to compile it myself.

hanaral avatar Apr 11 '21 13:04 hanaral

so far i am unable to replicate this in latest Fedora 34

JSN-1 avatar May 03 '21 20:05 JSN-1

@JSN-1 Afaik fedora uses the patched version from 34 onwards

hanaral avatar May 04 '21 11:05 hanaral

I have the same problem. These stripes are visible when using the terminal, files, firefox, tor-browser (it especially suffers), etc. The patch that was advised above did not give positive results for me.

kepebi avatar Sep 13 '21 10:09 kepebi

Seeing https://github.com/elementary/os-patches/tree/mutter-focal-patched has no related update so far, just a note that the patch in NixOS has been updated in https://github.com/NixOS/nixpkgs/pull/73906/commits/344a5a731b138c2e3b701d5ac09a4fb6e1a8a8a1.

bobby285271 avatar Oct 08 '21 02:10 bobby285271

This mutter bug also appears to have been fixed with mutter 40, as I am unable to reproduce it on either Fedora 34 or Fedora 35 with my latest builds. So the affected mutter versions seem to be 3.28.4 < x < 40.

decathorpe avatar Oct 08 '21 12:10 decathorpe

Im still with this bug on LibreOffice 7.2.4.1 (.deb and flatpack), using Elementary 6 (latest updates).

dmatavel avatar Dec 15 '21 18:12 dmatavel