Commit 72ca9268 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[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
parent 7b910c51
......@@ -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)
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment