Exemplo n.º 1
0
bool
WindowList::IsCovered(const Window &w) const
{
    const PixelRect rc = w.GetPosition();

    /* find the last full window which covers all the other windows
       behind it */
    for (auto i = list.begin();; ++i) {
        assert(i != list.end());

        Window &child = **i;
        if (&child == &w)
            /* didn't find a covering sibling so far */
            return false;

        if (child.IsVisible() &&
                child.GetLeft() <= rc.left &&
                child.GetRight() >= rc.right &&
                child.GetTop() <= rc.top &&
                child.GetBottom() >= rc.bottom)
            /* this sibling covers the specified window completely */
            return true;
    }
}