yshui / picom

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

Misaligned monitors render wrong when adding/removing monitors #1338

Closed ShadiestGoat closed 2 months ago

ShadiestGoat commented 2 months ago

Platform

Arch 6.10.10-arch1-1

GPU, drivers, and screen setup

Laptop w/ an extra monitor. NVIDIA GeForce GTX 1650 Ti Mobile

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 4096 MB
    Total available memory: 4096 MB
    Currently available dedicated video memory: 3303 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 560.35.03
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 560.35.03
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 560.35.03
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Monitors configured using xrandr: image

Monitors are managed via xrandr, which is called by autorandr

Environment

bspwm

picom version

v11 (/home/shady/.cache/yay/picom-git/picom revision 3899d2c)

Diagnostics [ 09/18/2024 12:47:02.087 c2_parse_target WARN ] Type specifier is deprecated. Type "c" specified on target "_GTK_FRAME_EXTENTS" will be ignored, you can remove it. **Version:** v11 (/home/shady/.cache/yay/picom-git/picom revision 3899d2c) ### Extensions: * Shape: Yes * RandR: Yes * Present: Present ### Misc: * Use Overlay: No * Config file specified: None * Config file used: /home/shady/.config/picom/picom.conf ### Drivers (inaccurate): NVIDIA, modesetting ### Backend: glx * Driver vendors: * GLX: NVIDIA Corporation * GL: NVIDIA Corporation * GL renderer: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2 [ 09/18/2024 12:47:02.429 egl_init WARN ] The egl backend is still experimental, use with care. ### Backend: egl * Driver vendors: * EGL: NVIDIA * GL: NVIDIA Corporation * GL renderer: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2

Configuration:

Configuration file shadow = false; corner-radius = 8; rounded-corners-exclude = [ "class_g = 'Polybar'" ]; round-borders = 8; fading = true; no-fading-openclose = false; fade-in-step = 0.1; fade-out-step = 0.1; fade-delta = 9; blur: { method = "dual_kawase"; strength = 3; background = false; background-frame = false; background-fixed = false; } backend = "glx"; vsync = false; mark-wmwin-focused = true; mark-ovredir-focused = true; detect-client-opacity = true; detect-client-leader = true; blur-background-exclude = [ "class_g ?= 'zoom'", "name = 'rect-overlay'", "_GTK_FRAME_EXTENTS@:c", "class_g = 'LibreWolf'", "window_type = 'menu'", "window_type = 'dropdown_menu'", "window_type = 'popup_menu'", "window_type = 'utility'", "class_g = 'activate-linux'", ];

Steps of reproduction

  1. Start with a single monitor setup
  2. Launch picom
  3. Add a monitor in a vertical misalignment as show above

I can also reproduce a similar thing when removing the primary monitor

Expected behavior

Rendering to be normal and correctly aligned on each monitor

Current Behavior

Other details

Its only rendering thats wrong. Interactivity for windows is as if they were in the normal position

ShadiestGoat commented 2 months ago

Primary monitor bad render:

20240918_125617.jpg

Secondary monitor bad render:

20240918_125628.jpg

Also, killing picom resolves this issue. If picom is restarted after, its all good

ShadiestGoat commented 2 months ago

This was introduced in v12-rc4 (rc3 was working fine), this should be a prevents on releasing rc4

freeo commented 2 months ago

Had the same thing on awesomewm-git on desktop, different resolution on the screens. Only when I disconnected the primary monitor (DP-0) then HDMI-0 was displayed correctly! This was specific to --backend glx. This one worked fine picom --backend xrender though.

picom --version
v11 (/home/user/.cache/paru/clone/picom-git/picom revision 3899d2c)
Suyooo commented 2 months ago

Having a similar problem whenever monitor size changes in any way - either enabling/disabling another monitor, or just resizing a monitor.

It seems to be a similar issue as #1277 which has been fixed before. This problem has been introduced in commit f36c5e3 and I can reproduce it in both xfwm4 and herbstluftwm by changing my screen resolution from 720p to 1080p while picom is running, and restarting picom corrects the rendering. Backend change doesn't fix the problem, it just changes how the rendering error behaves.

Stebalien commented 2 months ago

I just ran into this as well. A quick bisect points at 0aa620255d4e0c5e73c08295a2654c9eb7dce1dd.

Suyooo commented 2 months ago

Tried moving the guard added for the Configure event into the else branch so it is ignored when the root window is affected, and it fixes the issue for me. Can you give it a try and see whether it does for you too, or whether it's a different issue? https://github.com/Suyooo/picom

Stebalien commented 2 months ago

Your fix works for me, thanks for tracking it down!

absolutelynothelix commented 2 months ago

@Suyooo, looks like that's the way it's intended to be. make a pull request maybe?

whooops, tagged a wrong person initially

vredesbyyrd commented 2 months ago

commit f7e6b34 fixed the issue on my system as well (awesomewm). As an ugly workaround I had a hook to reload picom on screen plug events, this is much better. Thanks!

Suyooo commented 2 months ago

@Suyooo, looks like that's the way it's intended to be. make a pull request maybe?

That was the plan, just wanted to make sure it's working for others before :) Going to submit it now