yshui / picom

A lightweight compositor for X11 with animation support
https://picom.app/
Other
4.18k stars 589 forks source link

popup_menu has clipping border when using --experimental-backends #907

Closed KnightWhoSaysNeeeowWumPing closed 2 years ago

KnightWhoSaysNeeeowWumPing commented 2 years ago

Platform

OS: Arch Linux Kernel: 5.15.74-1-lts

GPU, drivers, and screen setup

$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) UHD Graphics (TGL GT1) (0x9a60)
    Version: 22.2.1
    Accelerated: yes
    Video memory: 31828MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics (TGL GT1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.2.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.2.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.2.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

i3wm

picom version

$ picom --version
vgit-7e568
$ sudo pacman -Ss picom | head -n 1
community/picom 9.1-3 [installed]
Diagnostics ``` **Version:** vgit-7e568 ### Extensions: * Shape: Yes * XRandR: Yes * Present: Present ### Misc: * Use Overlay: No (Another compositor is already running) * Config file used: /home/user/.config/picom/picom.conf ### Drivers (inaccurate): modesetting ### Backend: glx * Driver vendors: * GLX: Mesa Project and SGI * GL: Intel * GL renderer: Mesa Intel(R) UHD Graphics (TGL GT1) * Accelerated: 1 ```

Configuration:

Configuration file ``` shadow = false; shadow-radius = 7; shadow-offset-x = -7; shadow-offset-y = -7; shadow-exclude = [ "name = 'Notification'", "class_g = 'Conky'", "class_g ?= 'Notify-osd'", "class_g = 'Cairo-clock'", "_GTK_FRAME_EXTENTS@:c", "(class_g = 'Firefox' || class_g = 'Thunderbird') && (window_type = 'utility' || window_type = 'popup_menu') && argb" ]; fading = true; fade-in-step = 0.03; fade-out-step = 0.03; fade-delta = 5 fade-exclude = [ "(class_g = 'Firefox' || class_g = 'Thunderbird') && (window_type = 'utility' || window_type = 'popup_menu') && argb" ] inactive-opacity = 1.0; inactive-opacity-override = false; active-opacity = 1.0 focus-exclude = [ "class_g = 'Cairo-clock'" ]; opacity-rule = [ "90:class_g = 'kitty' && focused", "75:class_g = 'kitty' && !focused" ] corner-radius = 0 rounded-corners-exclude = [ "window_type = 'dock'", "window_type = 'desktop'", "(class_g = 'Firefox' || class_g = 'Thunderbird') && (window_type = 'utility' || window_type = 'popup_menu') && argb" ]; blur-kern = "3x3box"; blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'", "_GTK_FRAME_EXTENTS@:c", "(class_g = 'Firefox' || class_g = 'Thunderbird') && (window_type = 'utility' || window_type = 'popup_menu') && argb" ]; backend = "xrender"; vsync = true; mark-wmwin-focused = true; mark-ovredir-focused = true; detect-rounded-corners = true; detect-client-opacity = true; detect-transient = true; glx-no-stencil = true; use-damage = true; log-level = "warn"; wintypes: { tooltip = { fade = true; shadow = true; opacity = 0.95; focus = true; full-shadow = false; }; dock = { shadow = false; clip-shadow-above = true; } dnd = { shadow = false; } popup_menu = { opacity = 1.0; fade = false; shadow = false; focus = false; full-shadow = false; clip-shadow-above = false; } dropdown_menu = { opacity = 1.0; fade = false; } }; ```

Steps of reproduction

  1. Starting picom as described below (using --experimental-backends --transparent-clipping)
  2. Starting e.g. Firefox and right clicking to trigger a popup_menu

Expected behavior

I want only my terminal kitty to be transparent in the following manner: The desktop wallpaper should be used as the actual background of the terminal - even if the terminal is in front of another application. To achieve this desired behavior, I followed the suggestion from #265 and start picom using the aforementioned configuration with the following line in my ~/.config/i3/config:

exec_always --no-startup-id picom --experimental-backends --transparent-clipping

This should render the wallpaper as terminal background within kitty (which works flawlessly) but should not affect other applications as they are not explicitly mentioned in the opacity-rule of the config above.

Current Behavior

popup_menus like those in Firefox, Thunderbird or Zoom are displayed with a border around them as seen in the following screenshot. Through this border, the actual desktop wallpaper is visible.

screenshot

Stack trace

/

OpenGL trace

/

Other details

As can be seen from my config, I already tried the solution from #836. I also tried disabling client side decorations as described in the archwiki and pointed out in #737. Furthermore, I don't see how the solution of #901 applies here, as I have not mentioned Firefox at all in my set of opacity-rules.

yshui commented 2 years ago

This unfortunately is not easy to solve on our side. Many firefox menus windows are slightly bigger than what's visible, with a transparent margin around the visible part. firefox either needs to stop doing this, or setup the shape of the window properly.

Meanwhile, there is #738 which can be used to conditionally disable transparent-clipping, which can be used to workaround this.

KnightWhoSaysNeeeowWumPing commented 2 years ago

Thank you very much for this workaround!

I can confirm that the following config setting works on a fresh master build of picom:

transparent-clipping-exclude = [
  "class_g = 'firefox'",
];

The strange border is gone.

For reference:

$ picom --version
vgit-2dae0

I'm looking forward to the next release containing this :smile: