Summary:
If the corner shadow tiles(top-left, top-right, and so on) tiles are missing,
then the left/top/right/bottom shadow tiles will overlap.
This diff addresses that problem by changing how the shadow texture
atlas is rendered:
* corner tiles will be drawn in the corners of the atlas(buildQuads
method expects them to be at the corners);
* top, right, bottom, and left tile will be aligned to the top-left
corner of the inner shadow rect.
For majority of desktop themes, the shadow texture atlas looks the same.
For example, here's for Aether:
Before:
{F6190484, layout=center, size=full}
After:
{F6190488, layout=center, size=full}
Depends on D14783
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14784
Summary:
Current implementation of buildQuads assumes that corner shadow tiles
are always present:
const QRectF leftRect(
topLeftRect.bottomLeft(),
bottomLeftRect.topRight());
but that assumption is wrong. For example, if the default panel is on
the bottom screen edge, then the calendar popup won't have the
bottom-left shadow tile(at least on Wayland). Which means that the left
shadow tile won't be visible because
topLeftRect.left() == bottomLeftRect.right().
Corner rectangles only have to influence height of the left/right tile
and width of the top/bottom tile. Width of the left/right tile and
height of the top/bottom tile should not be controlled by corner tiles.
Overall, this is how shadow quads are computed:
* Compute the outer rectangle;
* Compute target rectangle for each corner tile. If some corner tile is
missing, move the target rectangle to the corresponding corner of the
inner shadow rect and set its width and height to 0. We need to do
that to prevent top/right/bottom/left tiles from spanning over
corners:
{F6190219, layout=center, size=full}
We would rather prefer something like this if the top-left tile is
missing:
{F6190233, layout=center, size=full}
* Fix overlaps between corner tiles;
* Compute target rectangles for top, right, bottom, and left tiles;
* Fix overlaps between left/right and top/bottom shadow tiles.
Test Plan:
* Ran tests;
* Resized Konsole to its minimimum size(on X11 and Wayland);
* Opened the calendar popup(on X11 and Wayland):
Before:
{F6190344, layout=center, size=full}
After:
{F6190346, layout=center, size=full}
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: abetts, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D14783
Summary:
QPainter doesn't render decoration shadows. It renders only
shadows provided through ShadowInterface.
With this change, painting of shadows is done in similar way OpenGL backend is
currently doing.
Before
{F5734867, layout=center, size=full}
After
{F5734870, layout=center, size=full}
Depends on D10811 (dummy decoration with shadows in autotests)
Test Plan:
* start kwin with QPainter backend enabled:
```
KWIN_COMPOSE=Q kwin_wayland --xwayland --windowed
```
* open konsole and kate:
```
DISPLAY=:1 konsole
DISPLAY=:1 kate
```
Reviewers: #kwin, graesslin, davidedmundson
Reviewed By: davidedmundson
Subscribers: abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10943
Summary:
This problem appears if shadow corner tiles are too big and
some window has size smaller than 2 * shadowTileSize.
This change tries to address the problem above by exclusing
overlapping tile parts. If there are any two overlapping corners
then tile between them(top/right/bottom/left) is not rendered.
Also, because some corner tile parts can be excluded, corner tiles
are expected to be symmetrical(i.e. if we remove right half from
the top-left tile and left half from the top-right tile and
stick them together, they still look fine, there are no misalignments, etc).
Most shadows(e.g. shadows from Breeze) have such behaviour.
No tiles are overlapping
{F5728514, layout=center, size=full}
Overlapping tiles
{F5728516, layout=center, size=full}
And this is how it supposed to be
{F5728517, layout=center, size=full}
Test Plan:
* apply D11069 to Breeze
* in System Settings/Application Style/Window Decorations, choose "Very Large" shadow size
* open Konsole
* resize it to a minimum possible size
Reviewers: #kwin, graesslin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, ngraham, anemeth, abetts, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D10811
Summary:
While investigating BUG 387313 I noticed that blending might be disabled
for subsurfaces. Blending was disabled before rendering the subsurfaces
and it is not checked whether the surfaces have an alpha channel or not.
This change addresses this problem by disabling blending after all
subsurfaces have been rendered and enabling blending if a subsurface has
an alpha channel.
Unfortunately this does not fix the investigated bug.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10060
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.
No guarantee that the tests don't pick something up from the system env,
that needs more testing.
References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled
Test Plan: The tests which loaded helpers pass
Reviewers: #kwin, #plasma
Subscribers: plasma-devel, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D7543
Summary:
Under wayland we support high DPI putting by putting a separation
between the logical co-ordinate system and the resolution of rendered
assets.
When a window is on a high DPI screen, we should render at the higher
resolution.
Like the window scaling this handles any combination of a 2x scaled
decoration being rendered on a 1x screen or vice versa.
---
This patch is a bit different from the other scaling stuff. We have to
generate the quads *before* we have an updated texture with the new
scale. This means the scale isn't attached to the buffer like elsewhere.
That's why I added a property in TopLevel so there's still one canonical
source and things can't get out of sync.
BUG: 384765
Test Plan:
Crystal clear breeze and oxygen decos on my @2x display
Drag windows to attached @1x display, things still look OK when across 2
screens
Changing the scale of a screen updated the decos instantly
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel, kwin, #kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D8600
Summary:
Under wayland we support high DPI putting by putting a separation
between the logical co-ordinate system and the resolution of rendered
assets.
I didn't include window decorations in the previous wayland scaling
patchset. They were drawn them at a standard resolution, which is
implicitly scaled up.
This uses the Qt scaling, meaning oxygen and breeze (and others) get
perfect high DPI support with zero client changes.
Like the window scaling this handles any combination of a 2x scaled
decoration being rendered on a 1x screen or vice versa.
CCBUG: 384765
Test Plan:
export KWIN_COMPOSE=Q
Had two screens of different scales
It was the right size on both (as before)
Was super-sharp on the fancy screen
Reviewers: #plasma, hetzenecker, graesslin
Reviewed By: #plasma, graesslin
Subscribers: ngraham, graesslin, plasma-devel, kwin, #kwin
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8504
Summary:
With the new try of all compositor types supported there is an automatic
fallback from OpenGL to XRender/QPainter in case OpenGL setup failed.
So there is no need to invoke a method to do just that.
Reviewers: #kwin, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D8364