summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-20 21:00:29 (GMT)
committerfluxgen <fluxgen>2003-02-20 21:00:29 (GMT)
commit3e2586bc1b480ed8199146a7aca07aab7cbad7f4 (patch)
tree14998bde165890288df977bac5696e336c4b9511
parentab62678bc659b027a45a6619cd60ed50e4db531c (diff)
downloadfluxbox_lack-3e2586bc1b480ed8199146a7aca07aab7cbad7f4.zip
fluxbox_lack-3e2586bc1b480ed8199146a7aca07aab7cbad7f4.tar.bz2
fixed updateClientmenu each time we add or remove a window
-rw-r--r--src/Workspace.cc38
-rw-r--r--src/Workspace.hh1
2 files changed, 29 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
465void 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
460void Workspace::placeWindow(FluxboxWindow *win) { 478void Workspace::placeWindow(FluxboxWindow *win) {
461 Bool placed = False; 479 Bool placed = False;
diff --git a/src/Workspace.hh b/src/Workspace.hh
index 34b4c9f..613626b 100644
--- a/src/Workspace.hh
+++ b/src/Workspace.hh
@@ -95,6 +95,7 @@ protected:
95 void placeWindow(FluxboxWindow *win); 95 void placeWindow(FluxboxWindow *win);
96 96
97private: 97private:
98 void updateClientmenu();
98 99
99 BScreen &screen; 100 BScreen &screen;
100 FluxboxWindow *lastfocus; 101 FluxboxWindow *lastfocus;