Fix incorrect static_casts to Client
Replace by better dynamic_casts to AbstractClient.
This commit is contained in:
parent
5f429625f0
commit
f84b4758f2
5 changed files with 19 additions and 16 deletions
|
@ -179,7 +179,8 @@ NET::WindowType Deleted::windowType(bool direct, int supportedTypes) const
|
|||
|
||||
void Deleted::mainClientClosed(Toplevel *client)
|
||||
{
|
||||
m_mainClients.removeAll(static_cast<Client*>(client));
|
||||
if (AbstractClient *c = dynamic_cast<AbstractClient*>(client))
|
||||
m_mainClients.removeAll(c);
|
||||
}
|
||||
|
||||
xcb_window_t Deleted::frameId() const
|
||||
|
|
|
@ -1130,8 +1130,7 @@ Toplevel *InputRedirection::findToplevel(const QPoint &pos)
|
|||
// a deleted window doesn't get mouse events
|
||||
continue;
|
||||
}
|
||||
if (t->isClient()) {
|
||||
Client *c = static_cast<Client*>(t);
|
||||
if (AbstractClient *c = dynamic_cast<AbstractClient*>(t)) {
|
||||
if (!c->isOnCurrentActivity() || !c->isOnCurrentDesktop() || c->isMinimized() || !c->isCurrentTab()) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -315,7 +315,10 @@ void Workspace::lowerClient(AbstractClient* c, bool nogroup)
|
|||
unconstrained_stacking_order.prepend(c);
|
||||
if (!nogroup && c->isTransient()) {
|
||||
// lower also all windows in the group, in their reversed stacking order
|
||||
ClientList wins = ensureStackingOrder(static_cast<Client*>(c)->group()->members());
|
||||
ClientList wins;
|
||||
if (Client *client = dynamic_cast<Client*>(c)) {
|
||||
wins = ensureStackingOrder(client->group()->members());
|
||||
}
|
||||
for (int i = wins.size() - 1;
|
||||
i >= 0;
|
||||
--i) {
|
||||
|
|
21
scene.cpp
21
scene.cpp
|
@ -275,13 +275,13 @@ void Scene::paintSimpleScreen(int orig_mask, QRegion region)
|
|||
// Clip out the decoration for opaque windows; the decoration is drawn in the second pass
|
||||
opaqueFullscreen = false; // TODO: do we care about unmanged windows here (maybe input windows?)
|
||||
if (w->isOpaque()) {
|
||||
Client *c = NULL;
|
||||
if (topw->isClient()) {
|
||||
c = static_cast<Client*>(topw);
|
||||
AbstractClient *c = dynamic_cast<AbstractClient*>(topw);
|
||||
if (c) {
|
||||
opaqueFullscreen = c->isFullScreen();
|
||||
}
|
||||
Client *cc = dynamic_cast<Client*>(c);
|
||||
// the window is fully opaque
|
||||
if (c && c->decorationHasAlpha()) {
|
||||
if (cc && cc->decorationHasAlpha()) {
|
||||
// decoration uses alpha channel, so we may not exclude it in clipping
|
||||
data.clip = w->clientShape().translated(w->x(), w->y());
|
||||
} else {
|
||||
|
@ -739,8 +739,7 @@ const QRegion &Scene::Window::shape() const
|
|||
|
||||
QRegion Scene::Window::clientShape() const
|
||||
{
|
||||
if (toplevel->isClient()) {
|
||||
Client *c = static_cast< Client * > (toplevel);
|
||||
if (AbstractClient *c = dynamic_cast< AbstractClient * > (toplevel)) {
|
||||
if (c->isShade())
|
||||
return QRegion();
|
||||
}
|
||||
|
@ -788,14 +787,16 @@ void Scene::Window::resetPaintingEnabled()
|
|||
}
|
||||
if (!toplevel->isOnCurrentActivity())
|
||||
disable_painting |= PAINT_DISABLED_BY_ACTIVITY;
|
||||
if (toplevel->isClient()) {
|
||||
Client *c = static_cast<Client*>(toplevel);
|
||||
if (AbstractClient *c = dynamic_cast<AbstractClient*>(toplevel)) {
|
||||
if (c->isMinimized())
|
||||
disable_painting |= PAINT_DISABLED_BY_MINIMIZE;
|
||||
if (c->tabGroup() && c != c->tabGroup()->current())
|
||||
disable_painting |= PAINT_DISABLED_BY_TAB_GROUP;
|
||||
else if (c->isHiddenInternal())
|
||||
disable_painting |= PAINT_DISABLED;
|
||||
if (Client *cc = dynamic_cast<Client*>(c)) {
|
||||
if (cc->isHiddenInternal()) {
|
||||
disable_painting |= PAINT_DISABLED;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1386,8 +1386,7 @@ void SceneOpenGL::Window::endRenderWindow()
|
|||
|
||||
GLTexture *SceneOpenGL::Window::getDecorationTexture() const
|
||||
{
|
||||
if (toplevel->isClient()) {
|
||||
Client *client = static_cast<Client *>(toplevel);
|
||||
if (Client *client = dynamic_cast<Client *>(toplevel)) {
|
||||
if (client->noBorder()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue