Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: picom-trans doesn't work as expected with picom-12-rc2 #1315

Closed
zen2 opened this issue Aug 17, 2024 · 6 comments
Closed

Regression: picom-trans doesn't work as expected with picom-12-rc2 #1315

zen2 opened this issue Aug 17, 2024 · 6 comments

Comments

@zen2
Copy link

zen2 commented Aug 17, 2024

Platform

Gentoo linux amd64

GPU, drivers, and screen setup

nvidia-drivers 555.58.02
3840x1600 144Hz monitor with gsync
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
Dedicated video memory: 12288 MB
Total available memory: 12288 MB
Currently available dedicated video memory: 11345 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 555.58.02
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 555.58.02
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 555.58.02
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

xorg server
openbox

picom version

v12-rc2

Diagnostics **Version:** v11 (should be 12-rc2 !!!)

Extensions:

  • Shape: Yes
  • RandR: Yes
  • Present: Present

Misc:

  • Use Overlay: No

  • Config file specified: /opt/zentoo/scripts/picom.conf

  • Config file used: /opt/zentoo/scripts/picom.conf

Drivers (inaccurate):

NVIDIA

Backend: egl

  • Driver vendors:
  • EGL: NVIDIA
  • GL: NVIDIA Corporation
  • GL renderer: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2

Backend: glx

  • Driver vendors:
  • GLX: NVIDIA Corporation
  • GL: NVIDIA Corporation
  • GL renderer: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2

Configuration:

Configuration file
log-level = "ERROR";
log-file = "/tmp/picom-error.log";
dbus=false

backend = "glx";

glx-no-stencil = false;
glx-copy-from-front = false;
glx-no-rebind-pixmap = true; 
unredir-if-possible = false;
xrender-sync-fence = true;
use-damage = true;

mark-wmwin-focused = true;
mark-ovredir-focused = true;
use-ewmh-active-win = true;

shadow = true;
shadow-radius = 16;
shadow-offset-x = -16;
shadow-offset-y = -16;
shadow-opacity = 0.8;
shadow-ignore-shaped = true;
detect-rounded-corners = false;

shadow-exclude = [
	"name = 'Notification'",
	"name *= 'picom'",
	"name *= 'Chromium'",
	"name *= 'Chrome'",
	"class_g = 'wbar'",
	"class_g ?= 'Notify-osd'",
	"class_g = 'Firefox' && argb",
	"_GTK_FRAME_EXTENTS@:c",
	"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];

active-opacity = 1;
inactive-opacity = 1;
inactive-opacity-override = false;
detect-client-opacity = true;

opacity-rule = [
    "100:fullscreen",
    "95:class_g = 'URxvt'",
    "95:class_g = 'UXTerm'",
    "95:class_g = 'XTerm'",
    "95:class_g = 'Alacritty'",
    "100:window_type = 'normal'",       # Add a tiny bit of opacity to all normal windows to apply blur
    "95:window_type = 'dialog'",        # Add a tiny bit of opacity to all dialog windows to apply blur
    "95:window_type = 'popup_menu'",    # Add a tiny bit of opacity to all popup_menu windows to apply blur
    "95:window_type = 'notification'"   # Add a tiny bit of opacity to all popup_menu windows to apply blur
];

blur-background = false;

blur-background-exclude = [
    "window_type = 'desktop'",
    "window_type = 'dock'",
    "window_type = 'utility'",
    "window_type = 'notification'",
    "class_g = 'Firefox' && argb",
    "_GTK_FRAME_EXTENTS@:c"
];

fading = true;
fade-delta = 2;
fade-in-step = 0.03;
fade-out-step = 0.03;
fade-exclude = [
];

detect-client-leader = true;

focus-exclude = [
	"class_g = 'Cairo-clock'",
	"class_g ?= 'Steam'"
];

wintypes:
{
	tooltip = { fade = true; shadow = true; focus = false;	};
	normal = { shadow = true; };
	dock = { shadow = false; };
	dnd = { shadow = false; };
	popup_menu = { shadow = true; focus = false; opacity = 0.95; };
	dropdown_menu = { shadow = true; focus = false; opacity = false; };
	above = { shadow = true; };
	splash = { shadow = true; };
	utility = { focus = false; shadow = false; };
	notification = { shadow = true; };
	desktop = { shadow = false };
	menu = { focus = false };
	dialog = { shadow = true; };
    fullscreen = { shadow = false; opacity = 1; };
};

Steps of reproduction

  1. picom-trans -c -20

Expected behavior

Active window opacity should decrease of -20.

Current Behavior

Active window opacity doesn't change until moving window or select another window.

@yshui yshui closed this as completed in c397aa8 Aug 18, 2024
@yshui
Copy link
Owner

yshui commented Aug 18, 2024

Nice catch, should've been fixed now.

@zappolowski
Copy link

zappolowski commented Aug 30, 2024

I ran into the same issue but the patch didn't solve it. I tracked it down to using a new-style rule set of (also just one rule triggers the bug already)

}, {
    match = "focused",
    opacity = 0.9,
}, {
    match = "! focused",
    opacity = 0.6,

added to the current picom.sample.conf.

Full configuration file for easier copy-and-paste
#################################
#             Shadows           #
#################################

# Enabled client-side shadows on windows. Note desktop windows
# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow,
# unless explicitly requested using the wintypes option.
#
# Can be set per-window using rules.
#
# Default: false
shadow = true;

# The blur radius for shadows, in pixels.
#
# Default: 12
shadow-radius = 7;

# The opacity of shadows.
#
# Range: 0.0 - 1.0
# Default: 0.75
# shadow-opacity = .75

# The left offset for shadows, in pixels.
#
# Default: -15
shadow-offset-x = -7;

# The top offset for shadows, in pixels.
#
# Default: -15
shadow-offset-y = -7;

# Hex string color value of shadow. Formatted like "#RRGGBB", e.g. "#C0FFEE".
#
# Default: #000000
# shadow-color = "#000000"

# Crop shadow of a window fully on a particular monitor to that monitor. This is
# currently implemented using the X RandR extension.
#
# Default: false
# crop-shadow-to-monitor = false


#################################
#           Fading              #
#################################

# Fade windows in/out when opening/closing and when opacity changes,
# unless no-fading-openclose is used. Can be set per-window using rules.
#
# Default: false
fading = true;

# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028)
fade-in-step = 0.03;

# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03)
fade-out-step = 0.03;

# The time between steps in fade step, in milliseconds. (> 0, defaults to 10)
# fade-delta = 10

# Do not fade on window open/close.
# no-fading-openclose = false

# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc.
# no-fading-destroyed-argb = false


#################################
#   Transparency / Opacity      #
#################################

# Opacity of window titlebars and borders.
#
# Range: 0.1 - 1.0
# Default: 1.0 (disabled)
frame-opacity = 0.7;

# Use fixed inactive dim value, instead of adjusting according to window opacity.
#
# Default: false
# inactive-dim-fixed = true

#################################
#           Corners             #
#################################

# Sets the radius of rounded window corners. When > 0, the compositor will
# round the corners of windows. Does not interact well with
# `transparent-clipping`.
#
# Default: 0 (disabled)
corner-radius = 0

#################################
#            Blur               #
#################################

# Parameters for background blurring, see BLUR section in the man page for more information.
# blur-method =
# blur-size = 12
#
# blur-deviation = false
#
# blur-strength = 5

# Blur background of semi-transparent / ARGB windows.
# Can be set per-window using rules.
#
# Default: false
# blur-background = false

# Blur background of windows when the window frame is not opaque.
# Implies:
#    blur-background
#
# Default: false
# blur-background-frame = false

# Use fixed blur strength rather than adjusting according to window opacity.
#
# Default: false
# blur-background-fixed = false


# Specify the blur convolution kernel, with the following format:
# example:
#   blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1";
# Can also be a pre-defined kernel, see the man page.
#
# Default: ""
blur-kern = "3x3box";

#################################
#       General Settings        #
#################################

# Enable remote control via D-Bus. See the man page for more details.
#
# Default: false
# dbus = true

# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers.
# daemon = false

# Specify the backend to use: `xrender`, `glx`, or `egl`.
#
# Default: "xrender"
backend = "glx"

# Use higher precision during rendering, and apply dither when presenting the
# rendered screen. Reduces banding artifacts, but may cause performance
# degradation. Only works with OpenGL.
dithered-present = false;

# Enable/disable VSync.
#
# Default: false
vsync = true;

# Try to detect windows with rounded corners and don't consider them
# shaped windows. The accuracy is not very high, unfortunately.
#
# Has nothing to do with `corner-radius`.
#
# Default: false
detect-rounded-corners = true;

# Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers
# not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.
#
# Default: false
detect-client-opacity = true;

# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. May be more accurate,
# provided that the WM supports it.
#
# Default: false
# use-ewmh-active-win = false

# Unredirect all windows if a full-screen opaque window is detected,
# to maximize performance for full-screen windows. Known to cause flickering
# when redirecting/unredirecting windows.
#
# Default: false
# unredir-if-possible = false

# Delay before unredirecting the window, in milliseconds.
#
# Default: 0.
# unredir-if-possible-delay = 0

# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows
# in the same group focused at the same time.
#
# Default: false
detect-transient = true;

# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same
# group focused at the same time. This usually means windows from the same application
# will be considered focused or unfocused at the same time.
# 'WM_TRANSIENT_FOR' has higher priority if detect-transient is enabled, too.
#
# Default: false
# detect-client-leader = false

# Use of damage information for rendering. This cause the only the part of the
# screen that has actually changed to be redrawn, instead of the whole screen
# every time. Should improve performance.
#
# Default: false
use-damage = true;

# Use X Sync fence to wait for the completion of rendering of other windows,
# before using their content to render the current screen.
#
# Required for explicit sync drivers, such as nvidia.
#
# Default: false
# xrender-sync-fence = false

# GLX backend: Use specified GLSL fragment shader for rendering window
# contents. Read the man page for a detailed explanation of the interface.
#
# Can be set per-window using rules.
#
# window-shader-fg = "default"

# Force all windows to be painted with blending. Useful if you
# have a `window-shader-fg` that could turn opaque pixels transparent.
#
# Default: false
# force-win-blend = false

# Do not use EWMH to detect fullscreen windows.
# Reverts to checking if a window is fullscreen based only on its size and coordinates.
#
# Default: false
# no-ewmh-fullscreen = false

# Dimming bright windows so their brightness doesn't exceed this set value.
# Brightness of a window is estimated by averaging all pixels in the window,
# so this could comes with a performance hit.
# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled.
#
# Default: 1.0 (disabled)
# max-brightness = 1.0

# Make transparent windows clip other windows like non-transparent windows do,
# instead of blending on top of them. e.g. placing a transparent window on top
# of another window will cut a "hole" in that window, and show the desktop background
# underneath.
#
# Default: false
# transparent-clipping = false

# Set the log level. Possible values are:
#  "trace", "debug", "info", "warn", "error"
# in increasing level of importance. Case insensitive.
# If using the "TRACE" log level, it's better to log into a file
# using *--log-file*, since it can generate a huge stream of logs.
#
# Default: "warn"
# log-level = "warn";

# Set the log file.
# If *--log-file* is never specified, logs will be written to stderr.
# Otherwise, logs will to written to the given file, though some of the early
# logs might still be written to the stderr.
# When setting this option from the config file, it is recommended to use an absolute path.
#
# log-file = "/path/to/your/log/file"

# Write process ID to a file.
# write-pid-path = "/path/to/your/log/file"

# Rule-based per-window options.
#
# See WINDOW RULES section in the man page for how these work.
rules: ({
  match = "window_type = 'tooltip'";
  fade = false;
  shadow = true;
  opacity = 0.75;
  full-shadow = false;
}, {
  match = "window_type = 'dock'    || "
          "window_type = 'desktop' || "
          "_GTK_FRAME_EXTENTS@";
  blur-background = false;
}, {
  match = "window_type != 'dock'";
  # shader = "my_shader.frag";
}, {
  match = "window_type = 'dock' || "
          "window_type = 'desktop'";
  corner-radius = 0;
}, {
    match = "focused",
    opacity = 0.9,
}, {
    match = "! focused",
    opacity = 0.6,
}, {
  match = "name = 'Notification'   || "
          "class_g = 'Conky'       || "
          "class_g ?= 'Notify-osd' || "
          "class_g = 'Cairo-clock' || "
          "_GTK_FRAME_EXTENTS@";
  shadow = false;
})

# `@include` directive can be used to include additional configuration files.
# Relative paths are search either in the parent of this configuration file
# (when the configuration is loaded through a symlink, the symlink will be
# resolved first). Or in `$XDG_CONFIG_HOME/picom/include`.
#
# @include "extra.conf"

@yshui
Copy link
Owner

yshui commented Aug 30, 2024

@zappolowski if the opacity is set by rules then the opacity property (which is what picom-trans sets) is ignored.

@zappolowski
Copy link

@yshui is there a recommended workaround to get something like the old behavior with the new approach? With old behavior I mean: inactive-opacity = 0.6 and active-opacity = 0.9 as initial values but also having the possibility of adjusting the values as needed?

PS: If you consider discussing it in the scope of this issue to be wrong, we can also move it to the discussions section.

@yshui
Copy link
Owner

yshui commented Aug 30, 2024

you can match ! _NET_WM_WINDOW_OPACITY

@zen2
Copy link
Author

zen2 commented Sep 12, 2024

I got the same problem that @zappolowski now.
I currently use basic rules like this:

opacity-rule = [
    "100:fullscreen",
    "95:class_g = 'URxvt'",
    "95:class_g = 'UXTerm'",
    "95:class_g = 'XTerm'",
    "95:class_g = 'Alacritty'",
    "100:window_type = 'normal'",       # Add a tiny bit of opacity to all normal windows to apply blur
    "95:window_type = 'dialog'",        # Add a tiny bit of opacity to all dialog windows to apply blur
    "95:window_type = 'popup_menu'",    # Add a tiny bit of opacity to all popup_menu windows to apply blur
    "95:window_type = 'notification'"   # Add a tiny bit of opacity to all popup_menu windows to apply blur
];

Before, with this configuration, I get used to modify window opacity by mouse button mapping (scroll wheel on title bar) and it was working perfectly.

So now how can I set opacity at window/class creation and then use picom-trans afterwards on windows ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants