Remove AbstractClient plumbing casts in Workspace
This commit is contained in:
parent
31d1d13de5
commit
348e20e20f
3 changed files with 11 additions and 16 deletions
|
@ -424,9 +424,8 @@ AbstractClient *Workspace::clientUnderMouse(Output *output) const
|
||||||
{
|
{
|
||||||
auto it = stackingOrder().constEnd();
|
auto it = stackingOrder().constEnd();
|
||||||
while (it != stackingOrder().constBegin()) {
|
while (it != stackingOrder().constBegin()) {
|
||||||
auto t = *(--it);
|
auto client = *(--it);
|
||||||
auto client = static_cast<AbstractClient *>(t->isClient() ? t : nullptr);
|
if (!client->isClient()) {
|
||||||
if (!client) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1679,9 +1679,8 @@ bool Workspace::switchWindow(AbstractClient *c, Direction direction, QPoint curP
|
||||||
|
|
||||||
QList<AbstractClient *> clist = stackingOrder();
|
QList<AbstractClient *> clist = stackingOrder();
|
||||||
for (auto i = clist.rbegin(); i != clist.rend(); ++i) {
|
for (auto i = clist.rbegin(); i != clist.rend(); ++i) {
|
||||||
auto t = *i;
|
auto client = *i;
|
||||||
auto client = static_cast<AbstractClient *>(t->isClient() ? t : nullptr);
|
if (!client->isClient()) {
|
||||||
if (!client) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (client->wantsTabFocus() && *i != c && client->isOnDesktop(desktop) && !client->isMinimized() && (*i)->isOnCurrentActivity()) {
|
if (client->wantsTabFocus() && *i != c && client->isOnDesktop(desktop) && !client->isMinimized() && (*i)->isOnCurrentActivity()) {
|
||||||
|
|
|
@ -896,9 +896,8 @@ void Workspace::updateToolWindows(bool also_hide)
|
||||||
// SELI TODO: But maybe it should - what if a new client has been added that's not in stacking order yet?
|
// SELI TODO: But maybe it should - what if a new client has been added that's not in stacking order yet?
|
||||||
QVector<AbstractClient *> to_show, to_hide;
|
QVector<AbstractClient *> to_show, to_hide;
|
||||||
for (auto it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it) {
|
for (auto it = stacking_order.constBegin(); it != stacking_order.constEnd(); ++it) {
|
||||||
auto t = *it;
|
auto c = *it;
|
||||||
auto c = static_cast<AbstractClient *>(t->isClient() ? t : nullptr);
|
if (!c->isClient()) {
|
||||||
if (!c) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (c->isUtility() || c->isMenu() || c->isToolbar()) {
|
if (c->isUtility() || c->isMenu() || c->isToolbar()) {
|
||||||
|
@ -1109,9 +1108,8 @@ AbstractClient *Workspace::findClientToActivateOnDesktop(VirtualDesktop *desktop
|
||||||
if (options->isNextFocusPrefersMouse()) {
|
if (options->isNextFocusPrefersMouse()) {
|
||||||
auto it = stackingOrder().constEnd();
|
auto it = stackingOrder().constEnd();
|
||||||
while (it != stackingOrder().constBegin()) {
|
while (it != stackingOrder().constBegin()) {
|
||||||
auto t = *(--it);
|
auto client = *(--it);
|
||||||
auto client = static_cast<AbstractClient *>(t->isClient() ? t : nullptr);
|
if (!client->isClient()) {
|
||||||
if (!client) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1421,9 +1419,8 @@ void Workspace::setShowingDesktop(bool showing, bool animated)
|
||||||
{ // for the blocker RAII
|
{ // for the blocker RAII
|
||||||
StackingUpdatesBlocker blocker(this); // updateLayer & lowerClient would invalidate stacking_order
|
StackingUpdatesBlocker blocker(this); // updateLayer & lowerClient would invalidate stacking_order
|
||||||
for (int i = stacking_order.count() - 1; i > -1; --i) {
|
for (int i = stacking_order.count() - 1; i > -1; --i) {
|
||||||
auto t = stacking_order.at(i);
|
auto c = stacking_order.at(i);
|
||||||
auto c = static_cast<AbstractClient *>(t->isClient() ? t : nullptr);
|
if (c->isClient() && c->isOnCurrentDesktop()) {
|
||||||
if (c && c->isOnCurrentDesktop()) {
|
|
||||||
if (c->isDock()) {
|
if (c->isDock()) {
|
||||||
c->updateLayer();
|
c->updateLayer();
|
||||||
} else if (c->isDesktop() && c->isShown()) {
|
} else if (c->isDesktop() && c->isShown()) {
|
||||||
|
@ -1802,7 +1799,7 @@ AbstractClient *Workspace::findAbstractClient(std::function<bool(const AbstractC
|
||||||
AbstractClient *Workspace::findAbstractClient(const QUuid &internalId) const
|
AbstractClient *Workspace::findAbstractClient(const QUuid &internalId) const
|
||||||
{
|
{
|
||||||
auto t = findToplevel(internalId);
|
auto t = findToplevel(internalId);
|
||||||
return static_cast<AbstractClient *>(t && t->isClient() ? t : nullptr);
|
return t && t->isClient() ? t : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Unmanaged *Workspace::findUnmanaged(std::function<bool(const Unmanaged *)> func) const
|
Unmanaged *Workspace::findUnmanaged(std::function<bool(const Unmanaged *)> func) const
|
||||||
|
|
Loading…
Reference in a new issue