kwin/autotests/xcb_scaling_mock.cpp
David Edmundson 2073415f91 Ensure size is valid after maximising
In X11 when a window is maximised if the client is unable to fufill the
space provided we centre align the window.

With the new floating point geometry behaviour of centreing changes.
Instead of a 1 pixel gap at the top, we get a 0.5 pixel gap either side.
When we get into the codepath to "fix" the window in `closeHeight` we
only move the top, giving us an invalid buffer size.

We don't really want to change the logic here; on xwayland with the
scaling opt-out path it's feasible for a floating sized logical size to
still be representable. This code rounds to the native unit after all
the logic has taken effect.
2022-07-27 08:43:23 +00:00

34 lines
502 B
C++

/*
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2022 Aleix Pol Gonzalez <aleixpol@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <utils/xcbutils.h>
namespace KWin
{
uint32_t Xcb::toXNative(qreal value)
{
return value;
}
qreal Xcb::fromXNative(int value)
{
return value;
}
QSizeF Xcb::fromXNative(const QSize &value)
{
return value;
}
QRectF Xcb::nativeFloor(const QRectF &value)
{
return value;
}
}