diff options
author | fluxgen <fluxgen> | 2003-07-10 11:09:19 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-07-10 11:09:19 (GMT) |
commit | 1f855e63ac917ff8f15ece1ad3380e7d7559e2ce (patch) | |
tree | 999a9b392d0ea7f2942763f1ae95a697d3ee85a9 /src/IconBar.cc | |
parent | 481c0faeb50b86ad4fd7b946ca9e4a94932a382f (diff) | |
download | fluxbox-1f855e63ac917ff8f15ece1ad3380e7d7559e2ce.zip fluxbox-1f855e63ac917ff8f15ece1ad3380e7d7559e2ce.tar.bz2 |
fixed so we cant have multiple instances of fluxbox window in iconbar
Diffstat (limited to 'src/IconBar.cc')
-rw-r--r-- | src/IconBar.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/IconBar.cc b/src/IconBar.cc index fa7478f..7e5f31d 100644 --- a/src/IconBar.cc +++ b/src/IconBar.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: IconBar.cc,v 1.38 2003/06/26 12:22:42 rathnor Exp $ | 22 | // $Id: IconBar.cc,v 1.39 2003/07/10 11:09:19 fluxgen Exp $ |
23 | 23 | ||
24 | #include "IconBar.hh" | 24 | #include "IconBar.hh" |
25 | 25 | ||
@@ -99,7 +99,17 @@ IconBar::~IconBar() { | |||
99 | returns window to iconobj | 99 | returns window to iconobj |
100 | */ | 100 | */ |
101 | Window IconBar::addIcon(FluxboxWindow *fluxboxwin) { | 101 | Window IconBar::addIcon(FluxboxWindow *fluxboxwin) { |
102 | 102 | if (fluxboxwin == 0) | |
103 | return 0; | ||
104 | |||
105 | // we don't want dublicate instances | ||
106 | IconList::iterator it = m_iconlist.begin(); | ||
107 | IconList::iterator it_end = m_iconlist.end(); | ||
108 | for (; it != it_end; ++it) { | ||
109 | if ((*it)->getFluxboxWin() == fluxboxwin) | ||
110 | return 0; | ||
111 | } | ||
112 | |||
103 | Window iconwin = createIconWindow(fluxboxwin, m_parent); | 113 | Window iconwin = createIconWindow(fluxboxwin, m_parent); |
104 | decorate(iconwin); | 114 | decorate(iconwin); |
105 | //add window object to list | 115 | //add window object to list |
@@ -121,6 +131,9 @@ Window IconBar::addIcon(FluxboxWindow *fluxboxwin) { | |||
121 | returns None if no window was found | 131 | returns None if no window was found |
122 | */ | 132 | */ |
123 | Window IconBar::delIcon(FluxboxWindow *fluxboxwin) { | 133 | Window IconBar::delIcon(FluxboxWindow *fluxboxwin) { |
134 | if (fluxboxwin == 0) | ||
135 | return 0; | ||
136 | |||
124 | Window retwin = None; | 137 | Window retwin = None; |
125 | IconBarObj *obj = findIcon(fluxboxwin); | 138 | IconBarObj *obj = findIcon(fluxboxwin); |
126 | if (obj) { | 139 | if (obj) { |