diff --git a/input.cpp b/input.cpp --- a/input.cpp +++ b/input.cpp @@ -2207,7 +2207,9 @@ 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) diff --git a/xdgshellclient.h b/xdgshellclient.h --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -58,6 +58,7 @@ XdgShellClient(KWayland::Server::XdgShellPopupInterface *surface); ~XdgShellClient() override; + QRect inputGeometry() const override; QRect bufferGeometry() const override; QStringList activities() const override; QPoint clientContentPos() const override; diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -295,6 +295,15 @@ 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;