[wayland] Provide correct input geometry for client-side decorated clients

Summary:
Currently, the input geometry for client-side decorated clients matches
the frame geometry, which makes it impossible for a user to resize such
clients by just dragging invisible area near window borders.

BUG: 416346

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: cblack, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26716
This commit is contained in:
Vlad Zahorodnii 2020-01-16 22:15:24 +02:00
parent 7b910c51b1
commit 72ca9268ce
3 changed files with 13 additions and 1 deletions

View file

@ -2207,7 +2207,9 @@ static bool acceptsInput(Toplevel *t, const QPoint &pos)
if (input.isEmpty()) {
return true;
}
return input.translated(t->pos()).contains(pos);
// TODO: What about sub-surfaces sticking outside the main surface?
const QPoint localPoint = pos - t->bufferGeometry().topLeft();
return input.contains(localPoint);
}
Toplevel *InputRedirection::findToplevel(const QPoint &pos)

View file

@ -295,6 +295,15 @@ void XdgShellClient::deleteClient(XdgShellClient *c)
delete c;
}
QRect XdgShellClient::inputGeometry() const
{
if (isDecorated()) {
return AbstractClient::inputGeometry();
}
// TODO: What about sub-surfaces sticking outside the main surface?
return m_bufferGeometry;
}
QRect XdgShellClient::bufferGeometry() const
{
return m_bufferGeometry;

View file

@ -58,6 +58,7 @@ public:
XdgShellClient(KWayland::Server::XdgShellPopupInterface *surface);
~XdgShellClient() override;
QRect inputGeometry() const override;
QRect bufferGeometry() const override;
QStringList activities() const override;
QPoint clientContentPos() const override;