From 1e00e1597a56a2671d429dfd49bbd6474a45c513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 11 Sep 2015 13:49:06 +0200 Subject: [PATCH] Workspace::keepTransientAbove operates on AbstractClient --- layers.cpp | 10 ++++++---- workspace.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/layers.cpp b/layers.cpp index d23c089233..b0e48a0b7a 100644 --- a/layers.cpp +++ b/layers.cpp @@ -567,7 +567,7 @@ ToplevelList Workspace::constrainedStackingOrder() for (i2 = stacking.size() - 1; i2 >= 0; --i2) { - Client *c2 = qobject_cast(stacking[ i2 ]); + AbstractClient *c2 = qobject_cast(stacking[ i2 ]); if (!c2) { continue; } @@ -640,7 +640,7 @@ ClientList Workspace::ensureStackingOrder(const ClientList& list) const // check whether a transient should be actually kept above its mainwindow // there may be some special cases where this rule shouldn't be enfored -bool Workspace::keepTransientAbove(const Client* mainwindow, const Client* transient) +bool Workspace::keepTransientAbove(const AbstractClient* mainwindow, const AbstractClient* transient) { // #93832 - don't keep splashscreens above dialogs if (transient->isSplash() && mainwindow->isDialog()) @@ -649,8 +649,10 @@ bool Workspace::keepTransientAbove(const Client* mainwindow, const Client* trans // the mainwindow, but only if they're group transient (since only such dialogs // have taskbar entry in Kicker). A proper way of doing this (both kwin and kicker) // needs to be found. - if (transient->isDialog() && !transient->isModal() && transient->groupTransient()) - return false; + if (const Client *ct = dynamic_cast(transient)) { + if (ct->isDialog() && !ct->isModal() && ct->groupTransient()) + return false; + } // #63223 - don't keep transients above docks, because the dock is kept high, // and e.g. dialogs for them would be too high too if (mainwindow->isDock()) diff --git a/workspace.h b/workspace.h index 0da4db72ac..93d76d99c0 100644 --- a/workspace.h +++ b/workspace.h @@ -485,7 +485,7 @@ private: void raiseClientWithinApplication(Client* c); void lowerClientWithinApplication(Client* c); bool allowFullClientRaising(const AbstractClient* c, xcb_timestamp_t timestamp); - bool keepTransientAbove(const Client* mainwindow, const Client* transient); + bool keepTransientAbove(const AbstractClient* mainwindow, const AbstractClient* transient); void blockStackingUpdates(bool block); void updateToolWindows(bool also_hide); void fixPositionAfterCrash(xcb_window_t w, const xcb_get_geometry_reply_t *geom);