Skip to content

Make FocusChain ignore closed windows

Vlad Zahorodnii requested to merge work/zzag/focus-chain-no-closed-windows into master

At the moment, the FocusChain has Q_ASSERT()s to prevent inserting closed windows back into the focus chain. It makes sense on paper. But, there are code paths that could still hypothetically call FocusChain::update(), they are harmless except the logic in the FocusChain.

So instead this change makes the FocusChain ignore closed windows, i.e. take a more defensive approach. There are a few reasons why it's worthwhile doing: the first is that it would prevent inserting closed windows back into the focus chain in release builds and potentially even back into the stack, debugging such crashes is absolutely no fun; the second is that it would be preferred to avoid sprinkling random isDeleted() checks in the Window code here and there and thus making the code harder to follow.

Merge request reports