matinlotfali / KDE-Rounded-Corners

Rounds the corners of your windows in KDE Plasma 5 and 6
GNU General Public License v3.0
638 stars 22 forks source link

The effect causes KWin to paint the area behind opaque windows, resulting in higher GPU usage #207

Open taj-ny opened 7 months ago

taj-ny commented 7 months ago

With just a few blurred windows in the background, the regions that have to be painted quickly add up, even if all the windows are covered by an opaque window.

I believe this is an accident, as data.setTranslucent() sets data.opaque to an empty region, but just a few lines later you are subtracting from that empty region. https://github.com/matinlotfali/KDE-Rounded-Corners/blob/master/src/ShapeCornersEffect.cpp#L137-L149 https://github.com/KDE/kwin/blob/v6.0.3/src/effect/effect.cpp#L20-L25

I commented out the data.setTranslucent() line and the GPU usage has dropped in the situation described at the beginning. I haven't noticed any issues with corners, shadows or the outline on Wayland and X11.

Although I should mention that Plasma 6 broke transparent color schemes and the translucent area behind some windows is no longer painted (bug report, video), resulting in artifacts on Wayland. data.setTranslucent() does fix this, so removing it could bring back the issue for some users.

I'm running Plasma 6.0.3 with KDE-Rounded-Corners 0.6.1.

matinlotfali commented 7 months ago

You are absolutely correct. The setTranslucent is there only because of the ugly artifacts. I should have written comments in the code about it.

matinlotfali commented 7 months ago

Sadly, I don't know how else I can prevent the artifact. I am open for suggestions.