scripting: Drop Window.shaped property
It should be irrelevant to the scripts and there's no matching abstraction on wayland. is_shape is made protected, but it will be eventually moved to an X11 specific subclass.
This commit is contained in:
parent
94f0e564be
commit
902c2feb12
3 changed files with 4 additions and 26 deletions
|
@ -72,7 +72,6 @@ Window::Window()
|
||||||
, ready_for_painting(false)
|
, ready_for_painting(false)
|
||||||
, m_internalId(QUuid::createUuid())
|
, m_internalId(QUuid::createUuid())
|
||||||
, m_client()
|
, m_client()
|
||||||
, is_shape(false)
|
|
||||||
, m_clientMachine(new ClientMachine(this))
|
, m_clientMachine(new ClientMachine(this))
|
||||||
, m_wmClientLeader(XCB_WINDOW_NONE)
|
, m_wmClientLeader(XCB_WINDOW_NONE)
|
||||||
, m_skipCloseAnimation(false)
|
, m_skipCloseAnimation(false)
|
||||||
|
@ -175,11 +174,7 @@ QDebug operator<<(QDebug debug, const Window *window)
|
||||||
|
|
||||||
void Window::detectShape(xcb_window_t id)
|
void Window::detectShape(xcb_window_t id)
|
||||||
{
|
{
|
||||||
const bool wasShape = is_shape;
|
|
||||||
is_shape = Xcb::Extensions::self()->hasShape(id);
|
is_shape = Xcb::Extensions::self()->hasShape(id);
|
||||||
if (wasShape != is_shape) {
|
|
||||||
Q_EMIT shapedChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF Window::visibleGeometry() const
|
QRectF Window::visibleGeometry() const
|
||||||
|
@ -421,7 +416,7 @@ QVector<QRectF> Window::shapeRegion() const
|
||||||
|
|
||||||
const QRectF bufferGeometry = this->bufferGeometry();
|
const QRectF bufferGeometry = this->bufferGeometry();
|
||||||
|
|
||||||
if (shape()) {
|
if (is_shape) {
|
||||||
auto cookie = xcb_shape_get_rectangles_unchecked(kwinApp()->x11Connection(), frameId(), XCB_SHAPE_SK_BOUNDING);
|
auto cookie = xcb_shape_get_rectangles_unchecked(kwinApp()->x11Connection(), frameId(), XCB_SHAPE_SK_BOUNDING);
|
||||||
UniqueCPtr<xcb_shape_get_rectangles_reply_t> reply(xcb_shape_get_rectangles_reply(kwinApp()->x11Connection(), cookie, nullptr));
|
UniqueCPtr<xcb_shape_get_rectangles_reply_t> reply(xcb_shape_get_rectangles_reply(kwinApp()->x11Connection(), cookie, nullptr));
|
||||||
if (reply) {
|
if (reply) {
|
||||||
|
|
19
src/window.h
19
src/window.h
|
@ -243,11 +243,6 @@ class KWIN_EXPORT Window : public QObject
|
||||||
*/
|
*/
|
||||||
Q_PROPERTY(bool deleted READ isDeleted CONSTANT)
|
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.
|
* 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
|
* 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
|
bool readyForPainting() const; // true if the window has been already painted its contents
|
||||||
xcb_visualid_t visual() const;
|
xcb_visualid_t visual() const;
|
||||||
bool shape() const;
|
|
||||||
QRegion inputShape() const;
|
QRegion inputShape() const;
|
||||||
void setOpacity(qreal opacity);
|
void setOpacity(qreal opacity);
|
||||||
qreal opacity() const;
|
qreal opacity() const;
|
||||||
|
@ -1395,12 +1389,6 @@ Q_SIGNALS:
|
||||||
void closed();
|
void closed();
|
||||||
void windowShown(KWin::Window *window);
|
void windowShown(KWin::Window *window);
|
||||||
void windowHidden(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
|
* 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.
|
* a screen being removed/added or if the Window's geometry changes.
|
||||||
|
@ -1828,6 +1816,7 @@ protected:
|
||||||
void cleanTabBox();
|
void cleanTabBox();
|
||||||
|
|
||||||
QStringList m_activityList;
|
QStringList m_activityList;
|
||||||
|
bool is_shape = false;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void shadeHover();
|
void shadeHover();
|
||||||
|
@ -1840,7 +1829,6 @@ private:
|
||||||
int m_refCount = 1;
|
int m_refCount = 1;
|
||||||
QUuid m_internalId;
|
QUuid m_internalId;
|
||||||
Xcb::Window m_client;
|
Xcb::Window m_client;
|
||||||
bool is_shape;
|
|
||||||
std::unique_ptr<EffectWindowImpl> m_effectWindow;
|
std::unique_ptr<EffectWindowImpl> m_effectWindow;
|
||||||
std::unique_ptr<WindowItem> m_windowItem;
|
std::unique_ptr<WindowItem> m_windowItem;
|
||||||
std::unique_ptr<Shadow> m_shadow;
|
std::unique_ptr<Shadow> m_shadow;
|
||||||
|
@ -2159,11 +2147,6 @@ inline bool Window::isInternal() const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool Window::shape() const
|
|
||||||
{
|
|
||||||
return is_shape;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int Window::depth() const
|
inline int Window::depth() const
|
||||||
{
|
{
|
||||||
return bit_depth;
|
return bit_depth;
|
||||||
|
|
|
@ -1243,7 +1243,7 @@ void X11Window::maybeDestroyX11DecorationRenderer()
|
||||||
|
|
||||||
void X11Window::detectNoBorder()
|
void X11Window::detectNoBorder()
|
||||||
{
|
{
|
||||||
if (shape()) {
|
if (is_shape) {
|
||||||
noborder = true;
|
noborder = true;
|
||||||
app_noborder = true;
|
app_noborder = true;
|
||||||
return;
|
return;
|
||||||
|
@ -1384,7 +1384,7 @@ void X11Window::checkNoBorder()
|
||||||
|
|
||||||
void X11Window::updateShape()
|
void X11Window::updateShape()
|
||||||
{
|
{
|
||||||
if (shape()) {
|
if (is_shape) {
|
||||||
// Workaround for #19644 - Shaped windows shouldn't have decoration
|
// Workaround for #19644 - Shaped windows shouldn't have decoration
|
||||||
if (!app_noborder) {
|
if (!app_noborder) {
|
||||||
// Only when shape is detected for the first time, still let the user to override
|
// Only when shape is detected for the first time, still let the user to override
|
||||||
|
|
Loading…
Reference in a new issue