diff options
author | fluxgen <fluxgen> | 2003-02-20 21:00:29 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-02-20 21:00:29 (GMT) |
commit | 3e2586bc1b480ed8199146a7aca07aab7cbad7f4 (patch) | |
tree | 14998bde165890288df977bac5696e336c4b9511 /src/Workspace.cc | |
parent | ab62678bc659b027a45a6619cd60ed50e4db531c (diff) | |
download | fluxbox-3e2586bc1b480ed8199146a7aca07aab7cbad7f4.zip fluxbox-3e2586bc1b480ed8199146a7aca07aab7cbad7f4.tar.bz2 |
fixed updateClientmenu each time we add or remove a window
Diffstat (limited to 'src/Workspace.cc')
-rw-r--r-- | src/Workspace.cc | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/src/Workspace.cc b/src/Workspace.cc index 6015a37..6b79c19 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Workspace.cc,v 1.49 2003/02/20 12:06:26 rathnor Exp $ | 25 | // $Id: Workspace.cc,v 1.50 2003/02/20 21:00:29 fluxgen Exp $ |
26 | 26 | ||
27 | #include "Workspace.hh" | 27 | #include "Workspace.hh" |
28 | 28 | ||
@@ -155,14 +155,22 @@ int Workspace::addWindow(FluxboxWindow *w, bool place) { | |||
155 | 155 | ||
156 | } | 156 | } |
157 | */ | 157 | */ |
158 | FbTk::RefCount<FbTk::Command> | ||
159 | raise_and_focus(new RaiseFocusAndSetWorkspace(*this, *w)); | ||
160 | 158 | ||
161 | m_clientmenu.insert(w->getTitle().c_str(), raise_and_focus); | 159 | // find focused window position |
160 | /* Windows::iterator insert_point_it = m_windowlist.begin(); | ||
161 | for (;insert_point_it != m_windowlist.end(); ++insert_point_it) { | ||
162 | if ((*insert_point_it)->isFocused()) { | ||
163 | break; | ||
164 | } | ||
165 | } | ||
166 | // if we found focused window, insert our window directly after it | ||
167 | if (insert_point_it != m_windowlist.end()) | ||
168 | m_windowlist.insert(insert_point_it, w); | ||
169 | else // we didn't find it, so we just add it to stack | ||
170 | */ | ||
162 | m_windowlist.push_back(w); | 171 | m_windowlist.push_back(w); |
163 | 172 | updateClientmenu(); | |
164 | //update menugraphics | 173 | |
165 | m_clientmenu.update(); | ||
166 | 174 | ||
167 | if (!w->isStuck()) | 175 | if (!w->isStuck()) |
168 | screen.updateNetizenWindowAdd(w->getClientWindow(), m_id); | 176 | screen.updateNetizenWindowAdd(w->getClientWindow(), m_id); |
@@ -241,9 +249,7 @@ int Workspace::removeWindow(FluxboxWindow *w) { | |||
241 | break; | 249 | break; |
242 | } | 250 | } |
243 | } | 251 | } |
244 | 252 | updateClientmenu(); | |
245 | m_clientmenu.remove(w->getWindowNumber()); | ||
246 | m_clientmenu.update(); | ||
247 | 253 | ||
248 | if (!w->isStuck()) | 254 | if (!w->isStuck()) |
249 | screen.updateNetizenWindowDel(w->getClientWindow()); | 255 | screen.updateNetizenWindowDel(w->getClientWindow()); |
@@ -456,6 +462,18 @@ void Workspace::shutdown() { | |||
456 | } | 462 | } |
457 | } | 463 | } |
458 | 464 | ||
465 | void Workspace::updateClientmenu() { | ||
466 | m_clientmenu.removeAll(); | ||
467 | Windows::iterator win_it = m_windowlist.begin(); | ||
468 | Windows::iterator win_it_end = m_windowlist.end(); | ||
469 | for (; win_it != win_it_end; ++win_it) { | ||
470 | FbTk::RefCount<FbTk::Command> | ||
471 | raise_and_focus(new RaiseFocusAndSetWorkspace(*this, *(*win_it))); | ||
472 | |||
473 | m_clientmenu.insert((*win_it)->getTitle().c_str(), raise_and_focus); | ||
474 | } | ||
475 | m_clientmenu.update(); | ||
476 | } | ||
459 | 477 | ||
460 | void Workspace::placeWindow(FluxboxWindow *win) { | 478 | void Workspace::placeWindow(FluxboxWindow *win) { |
461 | Bool placed = False; | 479 | Bool placed = False; |