Bug 406380 - Gap between panel edge and panel shadow / apps with Qt 5.13 branch
Summary: Gap between panel edge and panel shadow / apps with Qt 5.13 branch
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Panel (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-09 22:00 UTC by Eike Hein
Modified: 2019-06-15 15:53 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.16.1


Attachments
Gap between panel edge and shadow (531.05 KB, image/png)
2019-04-09 22:00 UTC, Eike Hein
Details
Gap between panel edge and maximized window (531.05 KB, image/png)
2019-04-09 22:01 UTC, Eike Hein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eike Hein 2019-04-09 22:00:59 UTC
Created attachment 119323 [details]
Gap between panel edge and shadow

Looks like we have a visual regression on 5.13. Screenshots attached.
Comment 1 Eike Hein 2019-04-09 22:01:26 UTC
Created attachment 119324 [details]
Gap between panel edge and maximized window
Comment 2 David Edmundson 2019-04-09 22:27:47 UTC
Does scaling make a difference?
Comment 3 Eike Hein 2019-04-09 22:32:29 UTC
Doesn't seem so (tested by unsetting the env vars and restarting).
Comment 4 Gabriel H. 2019-05-18 04:10:24 UTC
I'm also having this issue, but only in some themes (such as Adapta). Breeze works fine.

I'm on 5.15.90 (beta). The latest stable build does not show this issue, however.
Comment 5 Friedrich W. H. Kossebau 2019-05-18 15:48:46 UTC
Never seen this very bug, but having messed around with panels for Plasma 5.16, I might be culprit.
To make sure:
* do you see this bug with Qt 5.12, or only 5.13?
* do you see this bug with latest KF5 from master?
* what happens if you change the panel width, does the symptom disappear in some widths?
* do you see this after a theme switch, or also after fresh start?
* which themes can this be seen with, and which ones not?

Seems like the outer part of the panel is not painted, by the margins of the icons over the background painted. This could be due to a bad mask set. Can you modify INSTALLPREFIX/share/plasma/shells/org.kde.plasma.desktop/contents/views/Panel.qml and comment out the line
"
property alias panelMask: root.mask
"
and see if it makes a difference? (if the property does not exist panelview sets a null mask=full rect)
Comment 6 Gabriel H. 2019-05-18 22:25:55 UTC
(In reply to Friedrich W. H. Kossebau from comment #5)
> Never seen this very bug, but having messed around with panels for Plasma
> 5.16, I might be culprit.
> To make sure:
> * do you see this bug with Qt 5.12, or only 5.13?

Only tested in 5.13.

> * do you see this bug with latest KF5 from master?

I have not tested master, either. I'm only using the Arch [kde-unstable] repo.

> * what happens if you change the panel width, does the symptom disappear in
> some widths?

The width does not affect it.

> * do you see this after a theme switch, or also after fresh start?

After a fresh start, too.

> * which themes can this be seen with, and which ones not?

It happens in Adapta, it doesn't happen in Breeze and Oxygen that I tried.
 
> Seems like the outer part of the panel is not painted, by the margins of the
> icons over the background painted. This could be due to a bad mask set. Can
> you modify
> INSTALLPREFIX/share/plasma/shells/org.kde.plasma.desktop/contents/views/
> Panel.qml and comment out the line
> "
> property alias panelMask: root.mask
> "
> and see if it makes a difference? (if the property does not exist panelview
> sets a null mask=full rect)

The problem does not happen after commenting the line.
Comment 7 Friedrich W. H. Kossebau 2019-05-18 23:44:56 UTC
(In reply to gabrielhuwe from comment #6)
> (In reply to Friedrich W. H. Kossebau from comment #5)
> > Seems like the outer part of the panel is not painted, by the margins of the
> > icons over the background painted. This could be due to a bad mask set. Can
> > you modify
> > INSTALLPREFIX/share/plasma/shells/org.kde.plasma.desktop/contents/views/
> > Panel.qml and comment out the line
> > "
> > property alias panelMask: root.mask
> > "
> > and see if it makes a difference? (if the property does not exist panelview
> > sets a null mask=full rect)
> 
> The problem does not happen after commenting the line.

Eek. Well, at least we have some entry point now.

Could you try another thing: remove any plasma data cache, by "rm .cache/plasma* -r" and restart Plasma another time. Still happens?

Still curious if this is trigered by Qt 5.13 only?

Or older KDE Frameworks, as it did some more fixes WRT mask update post KF 5.58 (so only in 5.59 in June).  There are two live images which one could test with, please see them linked from first section of https://frinring.wordpress.com/2019/05/15/please-test-improved-plasma-theme-switching-for-plasma-5-16/
Comment 8 Gabriel H. 2019-05-19 02:56:09 UTC
>Could you try another thing: remove any plasma data cache, by "rm .cache/plasma* -r" and restart Plasma another time. Still happens?

Still happens, yes.
Comment 9 Eike Hein 2019-05-20 04:03:56 UTC
I've had this issue for a few weeks as well, using the 'Arc Dark' theme. It's quite annoying :) Cache clears have no effect.
Comment 10 Michail Vourlakos 2019-06-14 14:25:29 UTC
(In reply to Eike Hein from comment #9)
> I've had this issue for a few weeks as well, using the 'Arc Dark' theme.
> It's quite annoying :) Cache clears have no effect.

I think I know what this is:

1. In Plasma 5.16 the panelview implementation was updated and is using the window::mask() which is updated based on the current plasma theme background
2. BUT struts are not updated based on the mask() but based on the thickness() of the panel window which may not be the thickness() provided by the mask() used 3. as such panel can have a gap that is showing the desktop background underneath
Comment 11 Friedrich W. H. Kossebau 2019-06-14 14:36:58 UTC
(In reply to Michail Vourlakos from comment #10)
> I think I know what this is:
> 
> 1. In Plasma 5.16 the panelview implementation was updated and is using the
> window::mask() which is updated based on the current plasma theme background
> 2. BUT struts are not updated based on the mask() but based on the
> thickness() of the panel window which may not be the thickness() provided by
> the mask() used 3. as such panel can have a gap that is showing the desktop
> background underneath

Interesting idea. Will give a look next. Still curious though why the mask would be smaller then the panel, as the theme data for panel-background of at least the Adapta theme should provide a solid mask for the full width. The mask as passed to kwin and used for blurring at least covers the full width, as can be seen be the "line" being the blurred wallpaper.

For now I have another patch as WIP (to be uploaded in some minutes) which simply adapts the logic WRT masks with panels to the one used for dialogs & tooltips, where no issues are seen. That should at least hide the bug for now, the real cause though still is to be researched.
Comment 12 Michail Vourlakos 2019-06-14 14:43:56 UTC
(In reply to Friedrich W. H. Kossebau from comment #11)
> (In reply to Michail Vourlakos from comment #10)
> > I think I know what this is:
> > 
> > 1. In Plasma 5.16 the panelview implementation was updated and is using the
> > window::mask() which is updated based on the current plasma theme background
> > 2. BUT struts are not updated based on the mask() but based on the
> > thickness() of the panel window which may not be the thickness() provided by
> > the mask() used 3. as such panel can have a gap that is showing the desktop
> > background underneath
> 
> Interesting idea. Will give a look next. Still curious though why the mask
> would be smaller then the panel, as the theme data for panel-background of
> at least the Adapta theme should provide a solid mask for the full width.
> The mask as passed to kwin and used for blurring at least covers the full
> width, as can be seen be the "line" being the blurred wallpaper.
> 
> For now I have another patch as WIP (to be uploaded in some minutes) which
> simply adapts the logic WRT masks with panels to the one used for dialogs &
> tooltips, where no issues are seen. That should at least hide the bug for
> now, the real cause though still is to be researched.

You can open panel-background svg file of Arc-Dark theme, you can notice at its mask elements that there is 1px. transparent gap when you select any of the mask edges
Comment 13 Friedrich W. H. Kossebau 2019-06-14 15:38:12 UTC
(In reply to Michail Vourlakos from comment #12)
> You can open panel-background svg file of Arc-Dark theme, you can notice at
> its mask elements that there is 1px. transparent gap when you select any of
> the mask edges

Oh, indeed. I had Ctrl-LMB clicked on the visible mask element from Adapta only and judged by the highlighted shape. Looking closer, I see now the actual elements with the mask ids are groups, incl. a transparent pixel. Same with Arc Dark (seems both files are pretty the same). Would be curious to know why they have those, other e.g. than Breeze. Still, that mask should only affect the tiled center by what I remember... and I saw some mask half-pixels mismatch also with Oxygen and other, so something else is still fishy.

Symptom-removing patch up now as https://phabricator.kde.org/D21803
At least ensures consistency with Plasma window elements and masks on them :)
Comment 14 Friedrich W. H. Kossebau 2019-06-15 10:38:56 UTC
(In reply to Michail Vourlakos from comment #12)
> You can open panel-background svg file of Arc-Dark theme, you can notice at
> its mask elements that there is 1px. transparent gap when you select any of
> the mask edges

The theme author meanwhile has removed as a reaction to the visual issues this extra transparent pixel, seems it was there by accident perhaps (though I assume there was some motivation to add this, possibly as workaround to other issues which either have been fixed meanwhile or still need fixing, yet to be found out): see discussion for fix at https://github.com/PapirusDevelopmentTeam/arc-kde/issues/110

In any case, the mask not covering the complete width is an error, the theme itself has no intent to have some transparent margin at the border. And adapting the struts might also not what we ever want to do, after all is the width of the panel itself defining which area should be covered, also is the value used for rendering any content, and the theme should just be about how the background looks like.

Currently the *mask-* elements are not documented at https://techbase.kde.org/Development/Tutorials/Plasma5/ThemeDetails this needs to be fixed as well. E.g. that the masks for border elements need possibly to have the same size as the border elements themselves.