Fix confined pointer being able to escape the surface

When using fractional scaling, an xwayland window's client geometry can
have some fractional part. When that's the case, .toRect() can shrink the
client geometry or extruding the decoration borders inside the surface.

On the other hand, the pointer is going to be confined as long as the
wl_surface is focused. If the focus jumps to the decoration, the pointer
constraint is going to be broken. Unfortunately, the focus can shift to
the decoration even though the wl_surface is still focused because of the
pesky .toRect().

BUG: 482448
CCBUG: 477124
This commit is contained in:
Vlad Zahorodnii 2024-03-05 12:06:32 +02:00
parent 0c8b3251e5
commit bfd755aee9

View file

@ -3483,7 +3483,7 @@ void InputDeviceHandler::updateDecoration()
Decoration::DecoratedClientImpl *decoration = nullptr;
auto hover = m_hover.window.data();
if (hover && hover->decoratedClient()) {
if (!hover->clientGeometry().toRect().contains(flooredPoint(position()))) {
if (!exclusiveContains(hover->clientGeometry(), flooredPoint(position()))) {
// input device above decoration
decoration = hover->decoratedClient();
}