[effects/screenedge] Support "hint-stretch-borders"
ClosedPublic

Authored by kossebau on Apr 16 2019, 11:00 PM.

Details

Summary

Some old themes have the flag set and also a style which expects the
borders to be stretched. Given that the documentation on techbase
describes widgets/glowbar still as "a frame without a prefix", one also
would assume that all the optional hints (which make sense) still apply.
Even more, the Air & Oxygen themes have the hint also set, though for
their rendering it makes no difference.
The small code needed seems worth the unbreaking of old themes as well
as giving theme creators another variable of freedom for their styles.

Test Plan

Glow bar still works on all corners and edges with all themes as before,
though rendering now as expected for themes which have the
"hint-stretch-borders" set.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Apr 16 2019, 11:00 PM
Restricted Application added a project: KWin. · View Herald TranscriptApr 16 2019, 11:00 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
kossebau requested review of this revision.Apr 16 2019, 11:00 PM
zzag accepted this revision.Apr 17 2019, 12:06 AM
zzag added a subscriber: zzag.

Please change prefix to "[effects/screenedge]".

effects/screenedge/screenedgeeffect.cpp
347–352

Could you please rename this variable? Maybe target? Not a serious issue but would be nice to have a bit descriptive variable names. :)

This revision is now accepted and ready to land.Apr 17 2019, 12:06 AM
kossebau retitled this revision from [screenedge effect] Support "hint-stretch-borders" to [effects/screenedge] Support "hint-stretch-borders".Apr 17 2019, 12:10 AM

@zzag Thanks for review.

effects/screenedge/screenedgeeffect.cpp
347–352

I tried to follow the name pattern of pixmapPosition, so thought it was descriptive, being the "rect" for the very "c" :)
target I would find less descriptive, being so generic, even given the context.
We see that naming is the most hard problem of software development :)
Will think about how to name before I land tomorrow, other name suggestions welcome.

davidedmundson accepted this revision.Apr 17 2019, 10:52 AM
davidedmundson added a subscriber: davidedmundson.

At some point it would be good to use the Plasma FrameSVG import. That does tiling and stretching all on the GPU in the render instead of creating giant pixmaps.
There's another hint "hint-compose-over-border" which I don't want duplicating, because it's mental.

This fix is definitely an improvement ++

At some point it would be good to use the Plasma FrameSVG import. That does tiling and stretching all on the GPU in the render instead of creating giant pixmaps.

Yes, that's what I initially tried to use, but I got lost over tracking pixmaps & images & resolution & final blitting and making sure to have the right parts painted, given that presence of any margins hints also brings the question what part of the border should be used for glow... so I escaped into this simple enough solution for now :) as the other code had been growing beyond the existing one in the time I gave myself.

There's another hint "hint-compose-over-border" which I don't want duplicating, because it's mental.

In the case of the glow the center is also not used, so that hint would not be interesting here, or?

This fix is definitely an improvement ++

Thanks for ++ :)

This revision was automatically updated to reflect the committed changes.