yshui / picom

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

Fullscreen windows not following opacity rule #403

Closed Keating950 closed 3 years ago

Keating950 commented 4 years ago

Platform

Arch Linux

GPU, drivers, and screen setup

Thinkpad T420 with Intel(R) HD Graphics 3000

Output of glxinfo -B:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) HD Graphics 3000 (SNB GT2) (0x126)
    Version: 20.0.6
    Accelerated: yes
    Video memory: 1536MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 3000 (SNB GT2)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.0 Mesa 20.0.6
OpenGL shading language version string: 1.30
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.0.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Environment

bspwm 0.9.7-10-g2ffd9c1

picom version

**Version:** vgit-e553e

### Extensions:

* Shape: Yes
* XRandR: Yes
* Present: Present

### Misc:

* Use Overlay: No (Another compositor is already running)
* Config file used: /home/bigfoot-lives/.config/picom.conf

### Drivers (inaccurate):

modesetting

Configuration:

backend = "glx";
glx-no-stencil = true;
glx-no-rebind-pixmap = true;
shadow = true;
shadow-radius = 5;
shadow-offset-x = -5;
shadow-offset-y = -5;
shadow-opacity = 0.5;

blur-background = true;

shadow-exclude = [
    "! name~=''",
    "name = 'Notification'",
    "name = 'Plank'",
    "name = 'Docky'",
    "name = 'Kupfer'",
    "name = 'xfce4-notifyd'",
    "name *= 'VLC'",
    "name *= 'compton'",
    "name *= 'picom'",
    "name *= 'Chromium'",
    "name *= 'Chrome'",
    "class_g = 'Firefox' && argb",
    "class_g = 'Conky'",
    "class_g = 'Kupfer'",
    "class_g = 'Synapse'",
    "class_g ?= 'Notify-osd'",
    "class_g ?= 'Cairo-dock'",
    "class_g ?= 'Xfce4-notifyd'",
    "class_g ?= 'Xfce4-power-manager'",
    "_GTK_FRAME_EXTENTS@:c",
    "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];

shadow-ignore-shaped = false;

opacity-rule = [
    "99:_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'",
]

fading = true;
fade-delta = 3;
fade-in-step = 0.03;
fade-out-step = 0.03;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
use-ewmh-active-win = true;
detect-rounded-corners = true;
detect-client-opacity = true;  # N.B. tried both settings, neither work
vsync = true;
dbe = true;
unredir-if-possible = false;
detect-transient = true;
detect-client-leader = true;

Steps of reproduction

Tested with both st and Alacritty. The results are the same whether I set their background opacities via built-in application settings or a picom rule; in both cases, they can be made semitransparent, but their level of opacity does not change when they are made fullscreen.

Expected behavior

Fullscreen semitransparent windows become fully opaque,

Current Behavior

When making a semitransparent window fullscreen, its opacity remains the same, despite having set the following opacity rule:

opacity-rule = [
    "99:_NET_WM_STATE@:32a *= '_NET_WM_STATE_FULLSCREEN'",
]

Xprop confirms that _NET_WM_STATE(ATOM) = _NET_WM_STATE_FULLSCREEN.

zen2 commented 4 years ago

I confirm this problem too here with NVIDIA drivers and glx backend (with and without experimental backend).

tryone144 commented 4 years ago

First of all, picom can't change the opacity/transparency set by an application itself. What you are trying to achieve can only work when the opacity is set through picom (or the _NET_WM_OPACITY atom).

Your opacity-rule does not work since the _NET_WM_STATE atom has multiple values but only the first one is checked, which will most likely be _NET_WM_STATE_FOCUSED. This is a limitation in the current rule matching implementation.

You can however use the built-in shortcut fullscreen for exactly this purpose:

opacity-rule = [
  "99:fullscreen",
  # other window specific rules...
]
zen2 commented 4 years ago
opacity-rule = [
  "99:fullscreen",
  # other window specific rules...
]

I got a question about opacity value: why use we have to 99 and not 100 ?

tryone144 commented 4 years ago

IIRC, this has been used in the past to keep the window technically "transparent" as changing to a fully opaque window could cause some inconsistencies in how (in-)active windows were handled. This hack should not be needed anymore with a recent version of picom and 100 should work as expected.

yshui commented 3 years ago

@tryone144 100 in opacity-rule used to mean "unset", IIRC.