diff --git a/src/window.cpp b/src/window.cpp index 681efa9fcf..f75d0621cb 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -72,7 +72,6 @@ Window::Window() , ready_for_painting(false) , m_internalId(QUuid::createUuid()) , m_client() - , is_shape(false) , m_clientMachine(new ClientMachine(this)) , m_wmClientLeader(XCB_WINDOW_NONE) , m_skipCloseAnimation(false) @@ -175,11 +174,7 @@ QDebug operator<<(QDebug debug, const Window *window) void Window::detectShape(xcb_window_t id) { - const bool wasShape = is_shape; is_shape = Xcb::Extensions::self()->hasShape(id); - if (wasShape != is_shape) { - Q_EMIT shapedChanged(); - } } QRectF Window::visibleGeometry() const @@ -421,7 +416,7 @@ QVector Window::shapeRegion() const const QRectF bufferGeometry = this->bufferGeometry(); - if (shape()) { + if (is_shape) { auto cookie = xcb_shape_get_rectangles_unchecked(kwinApp()->x11Connection(), frameId(), XCB_SHAPE_SK_BOUNDING); UniqueCPtr reply(xcb_shape_get_rectangles_reply(kwinApp()->x11Connection(), cookie, nullptr)); if (reply) { diff --git a/src/window.h b/src/window.h index 5fa6ba1516..77fbec583b 100644 --- a/src/window.h +++ b/src/window.h @@ -243,11 +243,6 @@ class KWIN_EXPORT Window : public QObject */ Q_PROPERTY(bool deleted READ isDeleted CONSTANT) - /** - * Whether the window has an own shape - */ - Q_PROPERTY(bool shaped READ shape NOTIFY shapedChanged) - /** * Whether the window does not want to be animated on window close. * There are legit reasons for this like a screenshot application which does not want it's @@ -691,7 +686,6 @@ public: bool readyForPainting() const; // true if the window has been already painted its contents xcb_visualid_t visual() const; - bool shape() const; QRegion inputShape() const; void setOpacity(qreal opacity); qreal opacity() const; @@ -1395,12 +1389,6 @@ Q_SIGNALS: void closed(); void windowShown(KWin::Window *window); void windowHidden(KWin::Window *window); - /** - * Signal emitted when the window's shape state changed. That is if it did not have a shape - * and received one or if the shape was withdrawn. Think of Chromium enabling/disabling KWin's - * decoration. - */ - void shapedChanged(); /** * Emitted whenever the Window's screen changes. This can happen either in consequence to * a screen being removed/added or if the Window's geometry changes. @@ -1828,6 +1816,7 @@ protected: void cleanTabBox(); QStringList m_activityList; + bool is_shape = false; private Q_SLOTS: void shadeHover(); @@ -1840,7 +1829,6 @@ private: int m_refCount = 1; QUuid m_internalId; Xcb::Window m_client; - bool is_shape; std::unique_ptr m_effectWindow; std::unique_ptr m_windowItem; std::unique_ptr m_shadow; @@ -2159,11 +2147,6 @@ inline bool Window::isInternal() const return false; } -inline bool Window::shape() const -{ - return is_shape; -} - inline int Window::depth() const { return bit_depth; diff --git a/src/x11window.cpp b/src/x11window.cpp index cbd749b57c..2e3ee39b51 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -1243,7 +1243,7 @@ void X11Window::maybeDestroyX11DecorationRenderer() void X11Window::detectNoBorder() { - if (shape()) { + if (is_shape) { noborder = true; app_noborder = true; return; @@ -1384,7 +1384,7 @@ void X11Window::checkNoBorder() void X11Window::updateShape() { - if (shape()) { + if (is_shape) { // Workaround for #19644 - Shaped windows shouldn't have decoration if (!app_noborder) { // Only when shape is detected for the first time, still let the user to override