Bug 455567 - blur mask behaves strangely for plasma theme default settings
Summary: blur mask behaves strangely for plasma theme default settings
Status: RESOLVED FIXED
Alias: None
Product: lattedock
Classification: Unmaintained
Component: application (other bugs)
Version First Reported In: 0.10.8
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Michail Vourlakos
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-18 21:33 UTC by doncbugs
Modified: 2022-06-25 18:36 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
The 2 svg files for demonstrating (8.43 KB, application/zip)
2022-06-18 21:33 UTC, doncbugs
Details
the 2 masks being very different (57.39 KB, image/png)
2022-06-18 21:36 UTC, doncbugs
Details
masks changes too much in latte (46.34 KB, image/png)
2022-06-22 01:44 UTC, doncbugs
Details
the global theme using latte (3.42 KB, application/zip)
2022-06-22 22:53 UTC, doncbugs
Details
50% opacity (top) vs 1% opacity (bottom) compared to plasma panel (36.41 KB, image/png)
2022-06-25 17:24 UTC, doncbugs
Details

Note You need to log in before you can comment on or make changes to this bug.
Description doncbugs 2022-06-18 21:33:40 UTC
Created attachment 149904 [details]
The 2 svg files for demonstrating

SUMMARY
Reducing the size of the blur mask 'radius' by .5px dramatically changes the appearance of the mask. Attached are the 2 svg files.


STEPS TO REPRODUCE
1. Optionally increase opacity of dock to max to see clearer and choose a colorful background
2. Set the panel background of your plasma theme to panel-background1.svgz
3. Reapply the plasma theme
4. Observe the corners of the dock. The blur should slightly protrude outward from the corners.
5. Set the panel background of your plasma theme to panel-background2.svgz and reapply
6. Observe that the mask has changed by more than ~.5 pixels. -why?

OBSERVED RESULT
The mask changes size by 2-3 pixels

EXPECTED RESULT
The mask should change by about .5 pixels

Operating System: KDE neon 5.25
KDE Plasma Version: 5.25.0
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4
Kernel Version: 5.13.0-51-generic (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
This was also tested on previous versions of Neon ~(5.24.4)
Comment 1 doncbugs 2022-06-18 21:36:15 UTC
Created attachment 149905 [details]
the 2 masks being very different
Comment 2 Michail Vourlakos 2022-06-19 05:21:25 UTC
1. show me screenshots to understand
2. plasma panels should have the same issue so nothing related to latte
Comment 3 doncbugs 2022-06-22 01:44:15 UTC
Created attachment 150032 [details]
masks changes too much in latte

The top image is the mask reduced by .5px. The plasma panel mask decreases a small amount. Latte decreases by a lot.

For the record, this bug isn't tied to 5.25, I just never got around to documenting and reporting it. The bug has been around for a while.
Comment 4 doncbugs 2022-06-22 01:47:45 UTC
Sorry, not the mask. I think whatever draws the panel svg over the blur is inaccurate.
Comment 5 Michail Vourlakos 2022-06-22 05:41:50 UTC
(In reply to doncbugs from comment #4)
> Sorry, not the mask. I think whatever draws the panel svg over the blur is
> inaccurate.

3. I need also your layout file to reproduce and give you more details about the issue
Comment 6 doncbugs 2022-06-22 22:53:59 UTC
Created attachment 150075 [details]
the global theme using latte
Comment 7 Michail Vourlakos 2022-06-23 05:40:43 UTC
(In reply to doncbugs from comment #6)
> Created attachment 150075 [details]
> the global theme using latte

I dont want theme, I want layout creating the screenshots you sent.

Right click dock, Layouts, Edit Layouts..., choose your layout, Export Layout
Comment 8 doncbugs 2022-06-24 02:35:08 UTC
with latte 10.6+, and plasma 5.24+, latte layout files can be included in global themes to reproduce full configurations. The layout file is in the theme.
Comment 9 Michail Vourlakos 2022-06-25 07:03:20 UTC
Git commit bdf92099bbc6f4262dd05915088c8185450dc799 by Michail Vourlakos.
Committed on 25/06/2022 at 07:00.
Pushed by mvourlakos into branch 'master'.

plasmatheme:for defaults settings use real mask

--follow the new panel background way to access its mask
and use it also for both the blur area and mask area when
they are really needed. Such a case in only when the user
has requested for plasma theme default settings

M  +29   -40   app/view/effects.cpp
M  +9    -2    app/view/effects.h
M  +7    -0    containment/package/contents/ui/BindingsExternal.qml
M  +3    -0    containment/package/contents/ui/background/MultiLayered.qml

https://invent.kde.org/plasma/latte-dock/commit/bdf92099bbc6f4262dd05915088c8185450dc799
Comment 10 Michail Vourlakos 2022-06-25 07:09:15 UTC
I dont know if this is fixed for you but the facts are the following:

1. your case scenario was when the user used plasma theme default settings (meaning default roundness, default panel shadow etc.)
2. the new approach is the one plasma panel is already doing, when background is directly drawn from the plasma svgs then from the same svgs the mask is calculated

you could try to test the new approach in the git version, it should make things drawn exactly like in plasma panels. especially when you compare plasma floating panels with your latte scenario.

my guess is that this issue was because of antialiasing or screen global scale.
Comment 11 doncbugs 2022-06-25 17:07:54 UTC
(In reply to Michail Vourlakos from comment #10)

> you could try to test the new approach in the git version

Sorry, was struggling to compile it on Neon. Consider adding libqt5waylandclient5-dev plasma-wayland-protocols and libwayland-dev to the Neon dependencies.

> it should make things drawn exactly like in plasma panels.

I don't know if I am a fan of this. From what I understand, the blur mask calculation adds a 1px margin all around it, regardless of what is specified in the svgs. This ended up causing gaps around the edges of dialogs at 100% scaling.

However, testing the latest latte-git, I do not appear to see this issue. The mask appears to only slightly bleed at the corners, which is consistent with plasma. This seems fixed.

> my guess is that this issue was because of antialiasing or screen global
> scale.

I think whatever latte does to allow raising the opacity of a translucent plasma theme to make it opaque is the reason. How the shape of that is calculated could be the reason why it's different.
Comment 12 doncbugs 2022-06-25 17:24:05 UTC
Created attachment 150152 [details]
50% opacity (top) vs 1% opacity (bottom) compared to plasma panel

I believe this demonstrates that the blur mask is not the problem, but rather the layer drawn on top that allows the user to raise the opacity of a translucent panel theme. At 1%, the plasma panel and latte look nearly identical. However, when the opacity is raised in latte to 50%, it can more clearly seen.
Comment 13 Michail Vourlakos 2022-06-25 18:34:23 UTC
(In reply to doncbugs from comment #11)
> (In reply to Michail Vourlakos from comment #10)
> 
> > you could try to test the new approach in the git version
> 
> Sorry, was struggling to compile it on Neon. Consider adding
> libqt5waylandclient5-dev plasma-wayland-protocols and libwayland-dev to the
> Neon dependencies.
> 

Installation.md file is totally maintained from community you can send a MR to be approved
Comment 14 Michail Vourlakos 2022-06-25 18:36:53 UTC
(In reply to doncbugs from comment #12)
> Created attachment 150152 [details]
> 50% opacity (top) vs 1% opacity (bottom) compared to plasma panel
> 
> I believe this demonstrates that the blur mask is not the problem, but
> rather the layer drawn on top that allows the user to raise the opacity of a
> translucent panel theme. At 1%, the plasma panel and latte look nearly
> identical. However, when the opacity is raised in latte to 50%, it can more
> clearly seen.

you can not compare plasma panel and latte panels based on opacity setting for the simple reason that panel-background.svg can not be trusted to provide opacity values from 0% to 100%. Latte solves this differently. But if the latte opacity value is set to "Default" then yes if we have different results and we can make them identical and track down what is different to fix it.