yshui / picom

A lightweight compositor for X11
Other
3.92k stars 576 forks source link

On KDE6 spectacle no longer becomes invisible while making rectangular selection #1230

Closed Hi-Angel closed 2 months ago

Hi-Angel commented 2 months ago

Platform

Archlinux

GPU, drivers, and screen setup

Environment

KDE + i3

picom version

11.2, picom --version is vgit-89c2c.

Diagnostics ``` **Version:** vgit-89c2c ### Extensions: * Shape: Yes * RandR: Yes * Present: Present ### Misc: * Use Overlay: No (Another compositor is already running) * Config file used: /home/constantine/.config/picom.conf ### Drivers (inaccurate): modesetting ### Backend: glx * Driver vendors: * GLX: Mesa Project and SGI * GL: Intel * GL renderer: Mesa Intel(R) UHD Graphics (CML GT2) * Accelerated: 1 ### Backend: egl * Driver vendors: * EGL: Mesa Project * EGL driver: iris * GL: Intel * GL renderer: Mesa Intel(R) UHD Graphics (CML GT2) ```

Configuration:

inactive-opacity = 0.85;

Steps of reproduction

I don't know if it's a picom or Spectacle problem, but the thing is, it does not reproduce if I disable picom. So it may be a regression in Spectacle, but it also might be a Picom bug that was hidden so far. So I reported the problem to KDE and now I'm creating a report here. It appeared after upgrading to KDE6 whereas picom has not been upgraded.


  1. Create config: echo 'inactive-opacity = 0.85;' > ~/.config/picom.conf
  2. Run picom
  3. Execute spectacle
  4. Press Rectangular Region button, which will start the process of making rectangular selection

Expected behavior

For the duration of making the selection the window will disappear

Current Behavior

Spectacle window either does not disappear, or it may partially disappear leaving a transparent rectangle behind, in which case pressing Escape and Rectangular Region again would make the next time full window appear rather than gray rectangle.

Other details

Screencast of the problem:

https://github.com/yshui/picom/assets/7935057/e452a26b-c93e-459e-8d17-85a1ac871fef

yshui commented 2 months ago

Can you try the linked PR?

Hi-Angel commented 2 months ago

Can you try the linked PR?

Sure, just tried, nothing seems to have changed, spectacle is still visible while making rectangular selection.

yshui commented 2 months ago

oh, didn't realize you weren't running the latest git version.

I think I have hit this problem before. IIRC, spectacle captures the screen first then lets you crop a region out of it, if spectacle captures the screen too quickly, it will capture the screen with itself still in it.

What if you use a 1 seconds delay, does that help?

Hi-Angel commented 2 months ago

What if you use a 1 seconds delay, does that help?

Haha, yes, in fact it does, I too found this workaround yesterday

I think I have hit this problem before. IIRC, spectacle captures the screen first then lets you crop a region out of it, if spectacle captures the screen too quickly, it will capture the screen with itself still in it.

Hmm, interesting. But that leave me wondering: why the problem stops happening if Picom isn't running?

Hi-Angel commented 2 months ago

Yo, I found out where the regression has happened in Spectacle! Ha! It was in commit https://github.com/KDE/spectacle/commit/efc267076 and the reason being is that Spectacle has always been setting a 80ms timeout after making its window invisible and before making a screenshot. However, that commit changed the condition which results in the timeout always being zero.

@yshui you are amazing, thank you very much! I would have never found it out wasn't it for you comment! Will send a fix to Spectacle then

Hi-Angel commented 2 months ago

For posterity: a Spectacle merge request https://invent.kde.org/graphics/spectacle/-/merge_requests/342