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

Weird blurring if using fractional scaling on Wayland. #149

Open AndGuz opened 10 months ago

AndGuz commented 10 months ago

Screenshot_20240123_223918 Effect enabled Screenshot_20240123_223927 Effect disabled

Haven't tested without scaling. it is a slight blurring and only happens sometimes.

matinlotfali commented 10 months ago

I confirm that I can also see this issue. I did some digging to find the root cause and I couldn't find any traces of what is going wrong. So I checked the source code of my inspiring built-in effect: Invert

Interestingly, the blurriness can also be observed on the "Invert" effect which is built by KWin devs.

So I conclude that this is a bug on the KWin side when a window is using a shader.

More digging, here are some of the reported items that I believe are related: https://bugs.kde.org/show_bug.cgi?id=480021 https://bugs.kde.org/show_bug.cgi?id=456965

debnath-d commented 10 months ago

I was so excited to try out this effect! Works really great apart from this issue, which makes it unusable :(

AndGuz commented 9 months ago

Maybe the issue will be fixed with plasma 6

matinlotfali commented 9 months ago

I opened this issue on the official KWin repo: https://invent.kde.org/plasma/kwin/-/issues/201

AndGuz commented 9 months ago

Did some testing and the blurriness is only there on fractional scaling, if i use integer scaling it doesn't happen. The effect is working beautifully apart from that. I'm using 100% scaling for now until the root cause get fixed on kwin. For now, i think is ok to close this issue :) (thanks for the awesome work you're doing, i hope this effect is used on plasma 6)

CeruleanDerpo commented 8 months ago

From what I understand maybe there is a fix? https://bugs.kde.org/show_bug.cgi?id=461283#c9

mufeedali commented 7 months ago

I think this should probably be reopened since the issue isn't present on the official effects anymore.

matinlotfali commented 7 months ago

Sadly the issue still stands and it is still present on effects that use shaders (i.e the official invert effect)

mufeedali commented 7 months ago

Sorry for the misreport, looks like the issue is still present in the Invert effect

BrandowLucas commented 6 months ago

I can reproduce

hector-macias1 commented 5 months ago

This issue is still a problem in plasma 5

sppfly commented 5 months ago

Same thing happens here at Plasma 6 with scaling as 150%. However some applications like Firefox and VSCode is not affected.

CeruleanDerpo commented 4 months ago

invert doesn't seem to blur to me (plasma 6.1, fedora 40), and the bug report about the blurring has been fixed, I am only getting the weird blur with kde rounded corners

CAB233 commented 4 months ago

my screen resolution is 2560x1600(ArchLinux plasma 6.1.2), so I tried 160% and the weird blur did not happen sorry, after careful comparison, there will still be blurring, but it is not very obvious at 160%

matinlotfali commented 4 months ago

I did another trial on Wayland and 125% and 150% fractional scaling.

On the latest KDE Neon (plasma 6.1.2, framework 6.3.0) the blurring is not happening anymore with either "invert" or "rounded corners" effects. So maybe the bugfix has landed.

May I ask others to test and report on their distributions? Please indicate versions in your reports.

CeruleanDerpo commented 4 months ago

Fedora 40 with Nvidia proprietary drivers and KDE 6.1, I'm still getting the blur on the rounded corners effect, but interestingly not on the invert effect

Edit I'm using 125% scaling on Wayland

mufeedali commented 4 months ago

Arch, Plasma 6.1.2. Still have blur on both the Invert and the Rounded corner effects. 125% scaling.

GrassBlock1 commented 4 months ago

I did another trial on Wayland and 125% and 150% fractional scaling.

On the latest KDE Neon (plasma 6.1.2, framework 6.3.0) the blurring is not happening anymore with either "invert" or "rounded corners" effects. So maybe the bugfix has landed.

May I ask others to test and report on their distributions? Please indicate versions in your reports.

Operating System: Arch Linux KDE Plasma Version: 6.1.2 KDE Frameworks Version: 6.3.0

Still blurry with Rounded corner effects with 140% scaling on wayland (maybe only serval applications?), but built-in invert not.

AndGuz commented 4 months ago

Operating System: OpenSUSE Tumbleweed (Snapshot 20240704) KDE Plasma Version: 6.1.2 KDE Frameworks: 6.3.0

Now I've discovered that is scaling factor dependent, for me the blurring is less on 125% but none on 140% at 1920x1080. It comes back at 150%, blurriness disappears on 160%. Also, that is app dependent, and the blurriness could be less in some areas but exaggerated in others (blurry titlebar, app ok). The desktop crashes when moving windows after scaling (on the settings). imagen (blurry klassy settings, kde settings ok)

Edit2: closing the klassy settings and open them again fixed the blurriness, so weird! My theory is that is rounding error related.

owosoup commented 3 months ago

Arch, Plasma 6.1.3, Qt 6.7.2, Kde frameworks 6.4.0, Wayland. 150% scaling on a 1080p 16:9 screen, I have the same issue.

mufeedali commented 3 months ago

My theory is that is rounding error related.

@AndGuz You seem to be right about this. All apps seem to be unaffected at certain windows sizes...

owosoup commented 3 months ago

What's strange is that it doesn't happen on some applications. On spotify, the blur is noticeable, but on firefox it never happens. Yakuake is also immune? It's strange. The blurring seems to happen when the window moves, especially with the plugin settings. But it also happens on its own after some time.

neo-nayan commented 3 months ago

I'm really hoping that this bug would be fixed. I miss rounded corners on plasma 6

saihaze commented 1 month ago

Would you try 160% instead of 150%? It looks a bit better on my 1600p monitor.

AndGuz commented 1 month ago

Hi, i think this will be resolved with the following change on the wayland scaling protocol: WAYLAND-PROTOCOLS, MR#313as it will allow compositor to put better denominators for the scaling of any window. if my theory about float scaling precision is true, then this will fix it. Quoting this message by Jonas Adahl from the MR:

Lets assume I have a 4K monitor with the resolution 3840 x 2400. If I have use the scaling factor s 1.75218 I get a logical monitor size 2192 x 1370. Multiplying the logical size with s, I get 3840 x 2400. With the 120 denominator, s is rounded to 1.75 (lets call it s120). With s120 I get the logical monitor size 2194 x 1371. Multiplying that with s120 I get 3840 x 2399. In practice that means a fullscreen surface wont cover the full screen, when using s120, but will do so when using s