stack&tile: don't allow stacking a window onto itself

Change-Id: Iefd4a49b5b4caf2c3cd478a77fe4673dcac40427
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5056
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Adrien Destugues 2022-03-01 18:53:21 +01:00 committed by Adrien Destugues
parent a12cf089ee
commit 83cb10bcbc

View File

@ -69,6 +69,14 @@ StackingEventHandler::HandleMessage(SATWindow* sender,
SATWindow* candidate = stackAndTile->GetSATWindow(window);
if (!candidate)
return false;
// Is that window already part of the stack?
if (area->WindowList().HasItem(candidate)) {
reply.StartMessage(B_MISMATCHED_VALUES);
reply.Flush();
break;
}
if (!parent->StackWindow(candidate))
return false;