all repos — fluxbox @ 1f855e63ac917ff8f15ece1ad3380e7d7559e2ce

custom fork of the fluxbox windowmanager

fixed so we cant have multiple instances of fluxbox window in iconbar
fluxgen fluxgen
commit

1f855e63ac917ff8f15ece1ad3380e7d7559e2ce

parent

481c0faeb50b86ad4fd7b946ca9e4a94932a382f

1 files changed, 15 insertions(+), 2 deletions(-)

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

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconBar.cc,v 1.38 2003/06/26 12:22:42 rathnor Exp $ +// $Id: IconBar.cc,v 1.39 2003/07/10 11:09:19 fluxgen Exp $ #include "IconBar.hh"

@@ -99,7 +99,17 @@ icons.

returns window to iconobj */ Window IconBar::addIcon(FluxboxWindow *fluxboxwin) { - + if (fluxboxwin == 0) + return 0; + + // we don't want dublicate instances + IconList::iterator it = m_iconlist.begin(); + IconList::iterator it_end = m_iconlist.end(); + for (; it != it_end; ++it) { + if ((*it)->getFluxboxWin() == fluxboxwin) + return 0; + } + Window iconwin = createIconWindow(fluxboxwin, m_parent); decorate(iconwin); //add window object to list

@@ -121,6 +131,9 @@ Return X Window of the removed iconobj

returns None if no window was found */ Window IconBar::delIcon(FluxboxWindow *fluxboxwin) { + if (fluxboxwin == 0) + return 0; + Window retwin = None; IconBarObj *obj = findIcon(fluxboxwin); if (obj) {