brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
16.97k stars 2.21k forks source link

[Linux] Black border around menus on desktop enviroments that do not use compositing #39040

Open pitsi opened 2 weeks ago

pitsi commented 2 weeks ago

Description

After the upgrade to 1.67, there is a big black border around every brave menu, e.g. the one on the right click as you can see in the screenshot below.

Steps to reproduce

  1. Make sure you are running a desktop enviroment (de for short) without compositing or with compositing disabled. Gnome is NOT such a de and I do not know about the other major ones.
  2. Upgrade brave to 1.67.
  3. Right click somewhere or click on the hamburger menu on the top right corner.

Actual result

This. The light blue background is part of the page behind it.

2024-06-14-070738_1280x1024_scrot

Expected result

This, minus the dropped shadows.

2024-06-14-071321_1280x1024_scrot

Reproduces how often

Easily reproduced

Brave version (brave://version info)

Brave   1.67.115 Chromium: 126.0.6478.56 (Official Build) (64-bit) 
Revision    e1f8b4850805c2eea958bad7220c5e6e9202efaa
OS  Linux

Channel information

Reproducibility

Miscellaneous information

Theoritically, the above is just this gtk4 issue. And this brings the question: was brave built with gtk4 for 1.67? Its dependencies still mention libgtk-3-0 though and it also follows my gtk3 theme. https://gitlab.gnome.org/GNOME/gtk/-/issues/4815 (please notice the gnome dev's comments there, i.e. "don't disable your compositor")

Moreover, this is not dependant on the gtk3/4 theme. Excluding my beautiful dark theme (numix), I also tried that ugly bright one that comes as the default in gnome (adwaita), but the result was the same. I am not a gnome user, I left it on 2009 when it was still at its 2.2x versions and I never looked back.

Last but not least, I can not test it on chromium 126 because it has not reached my repo yet.

willbprog127 commented 2 weeks ago

I am also seeing this, with or without graphical acceleration turned on.

Debian 12 x86_64, Fluxbox, AMD Radeon 540/540X/550/550X / RX 540X/550/550X

pitsi commented 2 weeks ago

Since fluxbox does not do compositing, please install a compositing manager like compton, launch it and notice the difference.

Debian and openbox user here, for more than a decade, who wanted to move to fluxbox a few months ago :P

willbprog127 commented 2 weeks ago

Thanks for the reply. :smile:

please install a compositing manager like compton

No thank you. I am using Fluxbox because I don't like compositing window managers, but I understand what you're saying. :+1:

willbprog127 commented 2 weeks ago

This issue is also present on non-compositing window manager on MATE desktop. I do not want to use compositing window manager and other apps work fine.

inicula commented 2 weeks ago

Also a problem on my Debian 12 + dwm setup. It was working fine prior to 1.67.

pitsi commented 2 weeks ago

Small thing I noticed. Changing the theme to qt or classic under brave://appearance does not fix the issue because it just changes the colors of brave's theme.

prss-ad commented 2 weeks ago

Same thing here. Using Qtile with picom, i see a semi transparent blurred shadow . Without picom a thick black border. Tested with : Brave Browser 126.1.67.116 Chromium 126.0.6478.55 Fedora Project (40) image

pitsi commented 2 weeks ago

I also used picom for my screenshot above (I installed one compositing manager at random), but it does not produce any blur on my end.

pitsi commented 2 weeks ago

I tried a few workarounds I found here and there that involve editing ~/.config/gtk-4.0/gtk.css and ~/.config/gtk-3.0/gtk.css and setting the shadow radius to 0px, but nothing worked on brave.

On obfuscate and file-roller though, the only gtk4 apps I have installed, this workaround seems to work perfectly. https://bbs.archlinux.org/viewtopic.php?id=294262

R0CKH0PP3R commented 2 weeks ago

To more clearly illustrate the regression from v1.66.118: brave_picom

Note that the scale changed too.

Distro: Manjaro Compositor: Picom Desktop: XFCE4

vargn commented 2 weeks ago

Seeing the same issue on Arch+i3.

vargn commented 2 weeks ago

I really hope this will be a hotfix soon.

casaschi commented 1 week ago

Same issue here, ubuntu 22.04 with Xfce4. Also it does not help that in the Xfce settings editor > xfwm4 > general > use_compositing is set as TRUE.

R0CKH0PP3R commented 1 week ago

Issue remains in v1.67.119.

prss-ad commented 1 week ago

Yes , still there, running Brave Browser 126.1.69.30 nightly.

R0CKH0PP3R commented 6 days ago

Issue resolved in v1.67.123 when using Picom. However, OP's issue remains in absence of compositor.

prss-ad commented 6 days ago

Sorry to disappoint, but the issue is still present in my case with or without picom .

Brave Browser 126.1.69.49 nightly Brave Browser 126.1.67.123 image

R0CKH0PP3R commented 6 days ago

@prss-ad - You need to exclude the gtk frame extents in your picom config:

shadow-exclude = [
    "_GTK_FRAME_EXTENTS@:c"
];

blur-background-exclude = [ 
    "_GTK_FRAME_EXTENTS@:c"
];
prss-ad commented 6 days ago

Thanks @R0CKH0PP3R but that did not work for me, but this did:

wintypes: { menu = { opacity = 1.0; shadow = false; blur-background=false; } };

zksyncetester commented 3 days ago

1 i have same problem when compositor sttoped google chrome dose not have this problem

vargn commented 3 days ago

R0CKH0PP3R's solution worked for me.

However, the context menu of Brave have a fade-in effect when activated. I tried modifying picom.conf to remove this effect and have the menu appear instantly, but I couldn't make it work. Anyone know if this is possible?

prss-ad commented 3 days ago

@vargn not really sure if this is a fix for you: wintypes: { menu = { fade=false; shadow = false; blur-background=false; } };

pitsi commented 21 hours ago

I would like to add that the problem is also visible on xfce with compositing disabled and that its "shadow" looks white like on the screenshot above, although it uses the same numix theme. Moreover, I tested it on chromium 126 and it does not happen.