Drop custom inputGeometry and inputTransformation in x11 and xdg-shell windows

Effectively, X11Window and XdgSurfaceWindow use same stuff. Using the
buffer geometry should be fine in InternalWindow too.
This commit is contained in:
Vlad Zahorodnii 2023-03-31 15:02:31 +03:00
parent 2233190e67
commit 4e8214e69e
6 changed files with 3 additions and 39 deletions

View file

@ -381,7 +381,7 @@ QRegion Window::inputShape() const
QMatrix4x4 Window::inputTransformation() const
{
QMatrix4x4 m;
m.translate(-x(), -y());
m.translate(-m_bufferGeometry.x(), -m_bufferGeometry.y());
return m;
}
@ -419,7 +419,7 @@ QRectF Window::inputGeometry() const
if (isDecorated()) {
return frameGeometry() + decoration()->resizeOnlyBorders();
}
return frameGeometry();
return bufferGeometry();
}
bool Window::isLocalhost() const

View file

@ -800,11 +800,8 @@ public:
/**
* @returns Transformation to map from global to window coordinates.
*
* Default implementation returns a translation on negative pos().
* @see pos
*/
virtual QMatrix4x4 inputTransformation() const;
QMatrix4x4 inputTransformation() const;
/**
* Returns @c true if the window can accept input at the specified position @a point.

View file

@ -2800,15 +2800,6 @@ xcb_window_t X11Window::wrapperId() const
return m_wrapper;
}
QRectF X11Window::inputGeometry() const
{
// Notice that the buffer geometry corresponds to the geometry of the frame window.
if (isDecorated()) {
return m_bufferGeometry + decoration()->resizeOnlyBorders();
}
return m_bufferGeometry;
}
QPointF X11Window::framePosToClientPos(const QPointF &point) const
{
qreal x = point.x();
@ -2890,13 +2881,6 @@ QSizeF X11Window::implicitSize() const
return clientSizeToFrameSize(m_client.geometry().size());
}
QMatrix4x4 X11Window::inputTransformation() const
{
QMatrix4x4 matrix;
matrix.translate(-m_bufferGeometry.x(), -m_bufferGeometry.y());
return matrix;
}
pid_t X11Window::pid() const
{
return info->pid();

View file

@ -87,8 +87,6 @@ public:
xcb_window_t wmClientLeader() const;
QString wmCommand();
QRectF inputGeometry() const override;
QPointF framePosToClientPos(const QPointF &point) const override;
QPointF clientPosToFramePos(const QPointF &point) const override;
QSizeF frameSizeToClientSize(const QSizeF &size) const override;
@ -102,7 +100,6 @@ public:
QRegion opaqueRegion() const;
QVector<QRectF> shapeRegion() const;
QMatrix4x4 inputTransformation() const override;
pid_t pid() const override;
QString windowRole() const override;

View file

@ -96,18 +96,6 @@ NET::WindowType XdgSurfaceWindow::windowType(bool direct) const
return m_windowType;
}
QRectF XdgSurfaceWindow::inputGeometry() const
{
return isDecorated() ? Window::inputGeometry() : bufferGeometry();
}
QMatrix4x4 XdgSurfaceWindow::inputTransformation() const
{
QMatrix4x4 transformation;
transformation.translate(-bufferGeometry().x(), -bufferGeometry().y());
return transformation;
}
XdgSurfaceConfigure *XdgSurfaceWindow::lastAcknowledgedConfigure() const
{
return m_lastAcknowledgedConfigure.get();

View file

@ -60,8 +60,6 @@ public:
NET::WindowType windowType(bool direct = false) const override;
QRectF frameRectToBufferRect(const QRectF &rect) const override;
QRectF inputGeometry() const override;
QMatrix4x4 inputTransformation() const override;
void destroyWindow() override;
void installPlasmaShellSurface(KWaylandServer::PlasmaShellSurfaceInterface *shellSurface);