From 5428edf3daec57f490518ac356f60cc1a05a3693 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Thu, 22 Jan 2015 10:09:08 +0100 Subject: 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. --- src/Screen.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 2ae63a1..5e6f38e 100644 --- a/src/Screen.cc +++ b/src/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(), w)); + Icons::iterator erase_it = find_if(iconList().begin(), + iconList().end(), + bind2nd(equal_to(), w)); // no need to send iconlist signal if we didn't // change the iconlist if (erase_it != m_icon_list.end()) { -- cgit v0.11.2