[DialogShadows] Use 0 offset for disabled borders on Wayland

Summary:
On Wayland, DialogShadows doesn't attach empty tiles for disabled
borders. Yet, it sets offset of 1 for them. This results in visual
artifacts like this

{F6206088, layout=center, size=full}

//KWin thinks that there is 1px tall shadow in the bottom.//

In general we don't need to pass empty shadow tiles for disabled
borders. Thus, that's fine to set 0 offset for them.

Test Plan:
* Started kwin_wayland:

    dbus-launch kwin_wayland --windowed --xwayland

* Launched latte-dock and kate:

    unset DISPLAY
    QT_QPA_PLATFORM=wayland latte-dock &
    QT_QPA_PLATFORM=wayland kate

* Opened calendar popup:

{F6206090, layout=center, size=full}

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D14946
This commit is contained in:
Vlad Zagorodniy 2018-08-20 13:35:45 +03:00
parent a3ea5dbe8f
commit 8497832a8b

View File

@ -611,7 +611,7 @@ void DialogShadows::Private::updateShadowWayland(const QWindow *window, Plasma::
}
QSize marginHint;
QMarginsF margins = QMarginsF(1, 1, 1, 1);
QMarginsF margins;
if (enabledBorders & Plasma::FrameSvg::TopBorder) {
marginHint = q->elementSize(QStringLiteral("shadow-hint-top-margin"));
if (marginHint.isValid()) {