all repos — fluxbox @ 5428edf3daec57f490518ac356f60cc1a05a3693

custom fork of the fluxbox windowmanager

Fix removing windows from icon list

std::remove_if() removes an item from a container and returns a
past-the-end iterator ... which equals m_icon_list.end(). As a result
the check

    if (erase_it != m_icon_list.end()) {
        iconList().erase(erase_it);
        iconListSig().emit(*this);
    }

will never succeed and thus the iconListSig() will never be emitted.
Mathias Gumz akira@fluxbox.org
commit

5428edf3daec57f490518ac356f60cc1a05a3693

parent

1ec4fb6b6cb6d4b93dddc40c59abf62552445ad2

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -797,9 +797,9 @@ void BScreen::removeIcon(FluxboxWindow *w) {

if (w == 0) return; - Icons::iterator erase_it = remove_if(iconList().begin(), - iconList().end(), - bind2nd(equal_to<FluxboxWindow *>(), w)); + Icons::iterator erase_it = find_if(iconList().begin(), + iconList().end(), + bind2nd(equal_to<FluxboxWindow *>(), w)); // no need to send iconlist signal if we didn't // change the iconlist if (erase_it != m_icon_list.end()) {