diff --git a/src/events.cpp b/src/events.cpp index 3b94c75503..054e9be769 100644 --- a/src/events.cpp +++ b/src/events.cpp @@ -370,7 +370,7 @@ bool X11Window::windowEvent(xcb_generic_event_t *e) default: { if (eventType == Xcb::Extensions::self()->shapeNotifyEvent()) { detectShape(); - Q_EMIT geometryShapeChanged(frameGeometry()); + Q_EMIT shapeChanged(); } if (eventType == Xcb::Extensions::self()->damageNotifyEvent()) { damageNotifyEvent(); @@ -692,7 +692,7 @@ void X11Window::configureNotifyEvent(xcb_configure_notify_event_t *e) Q_EMIT bufferGeometryChanged(old); Q_EMIT clientGeometryChanged(old); Q_EMIT frameGeometryChanged(old); - Q_EMIT geometryShapeChanged(old); + Q_EMIT shapeChanged(); } } diff --git a/src/scene/surfaceitem_wayland.cpp b/src/scene/surfaceitem_wayland.cpp index 5355f84952..0044d94e61 100644 --- a/src/scene/surfaceitem_wayland.cpp +++ b/src/scene/surfaceitem_wayland.cpp @@ -207,7 +207,7 @@ SurfaceItemXwayland::SurfaceItemXwayland(X11Window *window, Scene *scene, Item * : SurfaceItemWayland(window->surface(), scene, parent) , m_window(window) { - connect(window, &X11Window::geometryShapeChanged, this, &SurfaceItemXwayland::discardQuads); + connect(window, &X11Window::shapeChanged, this, &SurfaceItemXwayland::discardQuads); } QVector SurfaceItemXwayland::shape() const diff --git a/src/scene/surfaceitem_x11.cpp b/src/scene/surfaceitem_x11.cpp index cf0e57cb37..dcdad59451 100644 --- a/src/scene/surfaceitem_x11.cpp +++ b/src/scene/surfaceitem_x11.cpp @@ -19,8 +19,8 @@ SurfaceItemX11::SurfaceItemX11(X11Window *window, Scene *scene, Item *parent) { connect(window, &Window::bufferGeometryChanged, this, &SurfaceItemX11::handleBufferGeometryChanged); - connect(window, &X11Window::geometryShapeChanged, - this, &SurfaceItemX11::handleGeometryShapeChanged); + connect(window, &X11Window::shapeChanged, + this, &SurfaceItemX11::handleShapeChanged); m_damageHandle = xcb_generate_id(kwinApp()->x11Connection()); xcb_damage_create(kwinApp()->x11Connection(), m_damageHandle, window->frameId(), @@ -146,7 +146,7 @@ void SurfaceItemX11::handleBufferGeometryChanged(const QRectF &old) setSize(m_window->bufferGeometry().size()); } -void SurfaceItemX11::handleGeometryShapeChanged() +void SurfaceItemX11::handleShapeChanged() { scheduleRepaint(boundingRect()); discardQuads(); diff --git a/src/scene/surfaceitem_x11.h b/src/scene/surfaceitem_x11.h index cf3754a84b..12cf3bcafe 100644 --- a/src/scene/surfaceitem_x11.h +++ b/src/scene/surfaceitem_x11.h @@ -42,7 +42,7 @@ public: private Q_SLOTS: void handleBufferGeometryChanged(const QRectF &old); - void handleGeometryShapeChanged(); + void handleShapeChanged(); protected: std::unique_ptr createPixmap() override; diff --git a/src/x11window.cpp b/src/x11window.cpp index edd05ced2b..7392a455f1 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -326,7 +326,7 @@ X11Window::X11Window() connect(clientMachine(), &ClientMachine::localhostChanged, this, &X11Window::updateCaption); connect(options, &Options::configChanged, this, &X11Window::updateMouseGrab); connect(options, &Options::condensedTitleChanged, this, &X11Window::updateCaption); - connect(this, &X11Window::geometryShapeChanged, this, &X11Window::discardShapeRegion); + connect(this, &X11Window::shapeChanged, this, &X11Window::discardShapeRegion); if (kwinApp()->operationMode() == Application::OperationModeX11) { connect(this, &X11Window::moveResizeCursorChanged, this, [this](CursorShape cursor) { @@ -1315,7 +1315,7 @@ void X11Window::updateDecoration(bool check_workspace_pos, bool force) destroyDecoration(); } if (!noBorder()) { - createDecoration(oldgeom); + createDecoration(); } else { destroyDecoration(); } @@ -1333,7 +1333,7 @@ void X11Window::invalidateDecoration() updateDecoration(true, true); } -void X11Window::createDecoration(const QRectF &oldgeom) +void X11Window::createDecoration() { std::shared_ptr decoration(Workspace::self()->decorationBridge()->createDecoration(this)); if (decoration) { @@ -1345,19 +1345,18 @@ void X11Window::createDecoration(const QRectF &oldgeom) moveResize(QRectF(calculateGravitation(false), clientSizeToFrameSize(clientSize()))); maybeCreateX11DecorationRenderer(); - Q_EMIT geometryShapeChanged(oldgeom); + Q_EMIT shapeChanged(); } void X11Window::destroyDecoration() { - QRectF oldgeom = moveResizeGeometry(); if (isDecorated()) { QPointF grav = calculateGravitation(true); setDecoration(nullptr); maybeDestroyX11DecorationRenderer(); moveResize(QRectF(grav, clientSizeToFrameSize(clientSize()))); if (!isDeleted()) { - Q_EMIT geometryShapeChanged(oldgeom); + Q_EMIT shapeChanged(); } } m_decoInputExtent.reset(); @@ -1448,7 +1447,7 @@ void X11Window::setClientFrameExtents(const NETStrut &strut) moveResize(moveResizeGeometry()); // This will invalidate the window quads cache. - Q_EMIT geometryShapeChanged(frameGeometry()); + Q_EMIT shapeChanged(); } /** @@ -1563,7 +1562,7 @@ void X11Window::updateShape() // Decoration mask (i.e. 'else' here) setting is done in setMask() // when the decoration calls it or when the decoration is created/destroyed updateInputShape(); - Q_EMIT geometryShapeChanged(frameGeometry()); + Q_EMIT shapeChanged(); } static Xcb::Window shape_helper_window(XCB_WINDOW_NONE); @@ -4353,7 +4352,7 @@ void X11Window::moveResizeInternal(const QRectF &rect, MoveResizeMode mode) if (oldOutput != m_output) { Q_EMIT outputChanged(); } - Q_EMIT geometryShapeChanged(oldFrameGeometry); + Q_EMIT shapeChanged(); } void X11Window::updateServerGeometry() diff --git a/src/x11window.h b/src/x11window.h index 0af54c7629..710005a2c3 100644 --- a/src/x11window.h +++ b/src/x11window.h @@ -358,7 +358,7 @@ Q_SIGNALS: * Emitted whenever the Client's block compositing state changes. */ void blockingCompositingChanged(KWin::X11Window *client); - void geometryShapeChanged(const QRectF &old); + void shapeChanged(); private: void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1 @@ -437,7 +437,7 @@ private: void maybeCreateX11DecorationRenderer(); void maybeDestroyX11DecorationRenderer(); void updateDecoration(bool check_workspace_pos, bool force = false); - void createDecoration(const QRectF &oldgeom); + void createDecoration(); void destroyDecoration(); QWindow *findInternalWindow() const;