Invalidate decoration explicitly

Lets us to remove AbstractClient::updateDecoration().
This commit is contained in:
Vlad Zahorodnii 2021-12-08 15:21:48 +02:00
parent 01a46ff389
commit 70f46970da
9 changed files with 24 additions and 1 deletions

View file

@ -3750,6 +3750,10 @@ void AbstractClient::updateDecoration(bool check_workspace_pos, bool force)
qCWarning(KWIN_CORE, "%s doesn't support server side decorations", metaObject()->className()); qCWarning(KWIN_CORE, "%s doesn't support server side decorations", metaObject()->className());
} }
void AbstractClient::invalidateDecoration()
{
}
bool AbstractClient::noBorder() const bool AbstractClient::noBorder() const
{ {
return true; return true;

View file

@ -766,6 +766,7 @@ public:
* TODO: fix boolean traps * TODO: fix boolean traps
*/ */
virtual void updateDecoration(bool check_workspace_pos, bool force = false); virtual void updateDecoration(bool check_workspace_pos, bool force = false);
virtual void invalidateDecoration();
/** /**
* Returns whether the window provides context help or not. If it does, * Returns whether the window provides context help or not. If it does,

View file

@ -141,7 +141,7 @@ void DecorationBridge::initPlugin()
static void recreateDecorations() static void recreateDecorations()
{ {
Workspace::self()->forEachAbstractClient([](AbstractClient *c) { c->updateDecoration(true, true); }); Workspace::self()->forEachAbstractClient([](AbstractClient *c) { c->invalidateDecoration(); });
} }
void DecorationBridge::reconfigure() void DecorationBridge::reconfigure()

View file

@ -336,6 +336,11 @@ void InternalClient::updateDecoration(bool check_workspace_pos, bool force)
} }
} }
void InternalClient::invalidateDecoration()
{
updateDecoration(true, true);
}
void InternalClient::destroyClient() void InternalClient::destroyClient()
{ {
markAsZombie(); markAsZombie();

View file

@ -54,6 +54,7 @@ public:
bool takeFocus() override; bool takeFocus() override;
void setNoBorder(bool set) override; void setNoBorder(bool set) override;
void updateDecoration(bool check_workspace_pos, bool force = false) override; void updateDecoration(bool check_workspace_pos, bool force = false) override;
void invalidateDecoration() override;
void destroyClient() override; void destroyClient() override;
bool hasPopupGrab() const override; bool hasPopupGrab() const override;
void popupDone() override; void popupDone() override;

View file

@ -1110,6 +1110,11 @@ void X11Client::updateDecoration(bool check_workspace_pos, bool force)
updateFrameExtents(); updateFrameExtents();
} }
void X11Client::invalidateDecoration()
{
updateDecoration(true, true);
}
void X11Client::createDecoration(const QRect& oldgeom) void X11Client::createDecoration(const QRect& oldgeom)
{ {
KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this); KDecoration2::Decoration *decoration = Decoration::DecorationBridge::self()->createDecoration(this);

View file

@ -183,6 +183,7 @@ public:
bool takeFocus() override; bool takeFocus() override;
void updateDecoration(bool check_workspace_pos, bool force = false) override; void updateDecoration(bool check_workspace_pos, bool force = false) override;
void invalidateDecoration() override;
void updateShape(); void updateShape();

View file

@ -814,6 +814,11 @@ void XdgToplevelClient::updateDecoration(bool check_workspace_pos, bool force)
} }
} }
void XdgToplevelClient::invalidateDecoration()
{
updateDecoration(true, true);
}
bool XdgToplevelClient::supportsWindowRules() const bool XdgToplevelClient::supportsWindowRules() const
{ {
return true; return true;

View file

@ -140,6 +140,7 @@ public:
bool noBorder() const override; bool noBorder() const override;
void setNoBorder(bool set) override; void setNoBorder(bool set) override;
void updateDecoration(bool check_workspace_pos, bool force = false) override; void updateDecoration(bool check_workspace_pos, bool force = false) override;
void invalidateDecoration() override;
QString preferredColorScheme() const override; QString preferredColorScheme() const override;
bool supportsWindowRules() const override; bool supportsWindowRules() const override;
bool takeFocus() override; bool takeFocus() override;