Make Toplevel::opacity virtual and copy it to Deleted

Toplevel::opacity() accesses the WinInfo, but for a Wayland client
we won't have the opacity through the WinInfo, so let's have it as
a virtual method that a subclass can override. Also it needs to be
copied to Deleted to not have a Deleted of a Wayland client crash
because it accesses the not existing WinInfo.
icc-effect-5.14.5
Martin Gräßlin 2015-03-04 07:56:51 +01:00
parent cfba4bacdf
commit 92d06a8c4b
3 changed files with 9 additions and 1 deletions

View File

@ -79,6 +79,7 @@ void Deleted::copyToDeleted(Toplevel* c)
transparent_rect = c->transparentRect();
m_layer = c->layer();
m_frame = c->frameId();
m_opacity = c->opacity();
if (WinInfo* cinfo = dynamic_cast< WinInfo* >(info))
cinfo->disable();
Client* client = dynamic_cast<Client*>(c);
@ -185,6 +186,11 @@ xcb_window_t Deleted::frameId() const
return m_frame;
}
double Deleted::opacity() const
{
return m_opacity;
}
} // namespace
#include "deleted.moc"

View File

@ -71,6 +71,7 @@ public:
bool wasClient() const {
return m_wasClient;
}
double opacity() const override;
const Decoration::Renderer *decorationRenderer() const {
return m_decorationRenderer;
@ -103,6 +104,7 @@ private:
ClientList m_mainClients;
bool m_wasClient;
Decoration::Renderer *m_decorationRenderer;
double m_opacity;
};
inline void Deleted::refWindow()

View File

@ -269,7 +269,7 @@ public:
xcb_visualid_t visual() const;
bool shape() const;
void setOpacity(double opacity);
double opacity() const;
virtual double opacity() const;
int depth() const;
bool hasAlpha() const;
virtual bool setupCompositing();