aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-04-09 23:20:40 (GMT)
committerfluxgen <fluxgen>2002-04-09 23:20:40 (GMT)
commit46e9b6e5462af0a05808c4d636526c04067a3623 (patch)
treebfd9ac1028247c732af84291e56a20391d8641ac
parentbd7951bcdad7e1c4dd6b5ff267cb85fc8cbf6d7e (diff)
downloadfluxbox_paul-46e9b6e5462af0a05808c4d636526c04067a3623.zip
fluxbox_paul-46e9b6e5462af0a05808c4d636526c04067a3623.tar.bz2
update from Workspace changes
-rw-r--r--src/Screen.cc32
-rw-r--r--src/Screen.hh4
-rw-r--r--src/Tab.cc4
-rw-r--r--src/Window.cc8
-rw-r--r--src/Windowmenu.cc4
-rw-r--r--src/Workspacemenu.cc4
-rw-r--r--src/fluxbox.cc15
7 files changed, 36 insertions, 35 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 79d627e..8cade50 100644
--- a/src/Screen.cc
+++ b/src/Screen.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: Screen.cc,v 1.44 2002/04/08 22:26:25 fluxgen Exp $ 25// $Id: Screen.cc,v 1.45 2002/04/09 23:15:21 fluxgen Exp $
26 26
27//use GNU extensions 27//use GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -371,12 +371,12 @@ resource(rm, screenname, altscreenname)
371 for (int i = 0; i < *resource.workspaces; ++i) { 371 for (int i = 0; i < *resource.workspaces; ++i) {
372 wkspc = new Workspace(this, workspacesList.size()); 372 wkspc = new Workspace(this, workspacesList.size());
373 workspacesList.push_back(wkspc); 373 workspacesList.push_back(wkspc);
374 workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); 374 workspacemenu->insert(wkspc->name().c_str(), wkspc->menu());
375 } 375 }
376 } else { 376 } else {
377 wkspc = new Workspace(this, workspacesList.size()); 377 wkspc = new Workspace(this, workspacesList.size());
378 workspacesList.push_back(wkspc); 378 workspacesList.push_back(wkspc);
379 workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); 379 workspacemenu->insert(wkspc->name().c_str(), wkspc->menu());
380 } 380 }
381 381
382 workspacemenu->insert(i18n-> 382 workspacemenu->insert(i18n->
@@ -720,8 +720,8 @@ int BScreen::addWorkspace(void) {
720 Workspace *wkspc = new Workspace(this, workspacesList.size()); 720 Workspace *wkspc = new Workspace(this, workspacesList.size());
721 workspacesList.push_back(wkspc); 721 workspacesList.push_back(wkspc);
722 //add workspace to workspacemenu 722 //add workspace to workspacemenu
723 workspacemenu->insert(wkspc->getName(), wkspc->getMenu(), 723 workspacemenu->insert(wkspc->name().c_str(), wkspc->menu(),
724 wkspc->getWorkspaceID() + 2); //+2 so we add it after "remove last" 724 wkspc->workspaceID() + 2); //+2 so we add it after "remove last"
725 725
726 workspacemenu->update(); 726 workspacemenu->update();
727 saveWorkspaces(workspacesList.size()); 727 saveWorkspaces(workspacesList.size());
@@ -739,12 +739,12 @@ int BScreen::removeLastWorkspace(void) {
739 if (workspacesList.size() > 1) { 739 if (workspacesList.size() > 1) {
740 Workspace *wkspc = workspacesList.back(); 740 Workspace *wkspc = workspacesList.back();
741 741
742 if (current_workspace->getWorkspaceID() == wkspc->getWorkspaceID()) 742 if (current_workspace->workspaceID() == wkspc->workspaceID())
743 changeWorkspaceID(current_workspace->getWorkspaceID() - 1); 743 changeWorkspaceID(current_workspace->workspaceID() - 1);
744 744
745 wkspc->removeAll(); 745 wkspc->removeAll();
746 746
747 workspacemenu->remove(wkspc->getWorkspaceID()+2); // + 2 is where workspaces starts 747 workspacemenu->remove(wkspc->workspaceID()+2); // + 2 is where workspaces starts
748 workspacemenu->update(); 748 workspacemenu->update();
749 749
750 //remove last workspace 750 //remove last workspace
@@ -766,12 +766,12 @@ void BScreen::changeWorkspaceID(unsigned int id) {
766 if (! current_workspace || id >= workspacesList.size()) 766 if (! current_workspace || id >= workspacesList.size())
767 return; 767 return;
768 768
769 if (id != current_workspace->getWorkspaceID()) { 769 if (id != current_workspace->workspaceID()) {
770 XSync(fluxbox->getXDisplay(), true); 770 XSync(fluxbox->getXDisplay(), true);
771 771
772 current_workspace->hideAll(); 772 current_workspace->hideAll();
773 773
774 workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, false); 774 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false);
775 775
776 if (fluxbox->getFocusedWindow() && 776 if (fluxbox->getFocusedWindow() &&
777 fluxbox->getFocusedWindow()->getScreen() == this && 777 fluxbox->getFocusedWindow()->getScreen() == this &&
@@ -784,7 +784,7 @@ void BScreen::changeWorkspaceID(unsigned int id) {
784 784
785 current_workspace = getWorkspace(id); 785 current_workspace = getWorkspace(id);
786 786
787 workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, true); 787 workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, true);
788 toolbar->redrawWorkspaceLabel(true); 788 toolbar->redrawWorkspaceLabel(true);
789 789
790 current_workspace->showAll(); 790 current_workspace->showAll();
@@ -803,7 +803,7 @@ void BScreen::sendToWorkspace(unsigned int id, bool changeWS) {
803 if (! current_workspace || id >= workspacesList.size()) 803 if (! current_workspace || id >= workspacesList.size())
804 return; 804 return;
805 805
806 if (id != current_workspace->getWorkspaceID()) { 806 if (id != current_workspace->workspaceID()) {
807 XSync(fluxbox->getXDisplay(), True); 807 XSync(fluxbox->getXDisplay(), True);
808 808
809 win = fluxbox->getFocusedWindow(); 809 win = fluxbox->getFocusedWindow();
@@ -840,12 +840,12 @@ void BScreen::addNetizen(Netizen *n) {
840 for (; it != it_end; ++it) { 840 for (; it != it_end; ++it) {
841 for (int i = 0; i < (*it)->getCount(); ++i) { 841 for (int i = 0; i < (*it)->getCount(); ++i) {
842 n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(), 842 n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(),
843 (*it)->getWorkspaceID()); 843 (*it)->workspaceID());
844 } 844 }
845 } 845 }
846 846
847 Window f = ((fluxbox->getFocusedWindow()) ? 847 Window f = ((fluxbox->getFocusedWindow()) ?
848 fluxbox->getFocusedWindow()->getClientWindow() : None); 848 fluxbox->getFocusedWindow()->getClientWindow() : None);
849 n->sendWindowFocus(f); 849 n->sendWindowFocus(f);
850} 850}
851 851
@@ -990,7 +990,7 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) {
990 Workspaces::iterator wit = workspacesList.begin(); 990 Workspaces::iterator wit = workspacesList.begin();
991 Workspaces::iterator wit_end = workspacesList.end(); 991 Workspaces::iterator wit_end = workspacesList.end();
992 for (; wit != wit_end; ++wit) { 992 for (; wit != wit_end; ++wit) {
993 session_stack[i++] = (*wit)->getMenu()->windowID(); 993 session_stack[i++] = (*wit)->menu()->windowID();
994 } 994 }
995 995
996 session_stack[i++] = workspacemenu->windowID(); 996 session_stack[i++] = workspacemenu->windowID();
@@ -1074,7 +1074,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ig
1074 if (! w) return; 1074 if (! w) return;
1075 1075
1076 if (wkspc_id >= workspaceNames.size()) 1076 if (wkspc_id >= workspaceNames.size())
1077 wkspc_id = current_workspace->getWorkspaceID(); 1077 wkspc_id = current_workspace->workspaceID();
1078 1078
1079 if (w->getWorkspaceNumber() == wkspc_id) 1079 if (w->getWorkspaceNumber() == wkspc_id)
1080 return; 1080 return;
diff --git a/src/Screen.hh b/src/Screen.hh
index 4c8ffae..025b65c 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -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: Screen.hh,v 1.28 2002/04/09 12:13:44 fluxgen Exp $ 25// $Id: Screen.hh,v 1.29 2002/04/09 23:20:40 fluxgen Exp $
26 26
27#ifndef SCREEN_HH 27#ifndef SCREEN_HH
28#define SCREEN_HH 28#define SCREEN_HH
@@ -121,7 +121,7 @@ public:
121 inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); } 121 inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); }
122 inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); } 122 inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); }
123 inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; } 123 inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; }
124 inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->getWorkspaceID(); } 124 inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); }
125 125
126 typedef std::vector<FluxboxWindow *> Icons; 126 typedef std::vector<FluxboxWindow *> Icons;
127 inline const unsigned int getCount(void) const { return workspacesList.size(); } 127 inline const unsigned int getCount(void) const { return workspacesList.size(); }
diff --git a/src/Tab.cc b/src/Tab.cc
index a14de09..4ade4f7 100644
--- a/src/Tab.cc
+++ b/src/Tab.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: Tab.cc,v 1.22 2002/04/03 23:01:04 fluxgen Exp $ 22// $Id: Tab.cc,v 1.23 2002/04/09 23:15:36 fluxgen Exp $
23 23
24#include "Tab.hh" 24#include "Tab.hh"
25 25
@@ -286,7 +286,7 @@ void Tab::stick() {
286 win->stuck = false; 286 win->stuck = false;
287 if (!win->isIconic()) { 287 if (!win->isIconic()) {
288 BScreen *screen = win->getScreen(); 288 BScreen *screen = win->getScreen();
289 screen->reassociateWindow(win, screen->getCurrentWorkspace()->getWorkspaceID(), true); 289 screen->reassociateWindow(win, screen->getCurrentWorkspace()->workspaceID(), true);
290 } 290 }
291 291
292 } else { 292 } else {
diff --git a/src/Window.cc b/src/Window.cc
index 80edb86..260fa7c 100644
--- a/src/Window.cc
+++ b/src/Window.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: Window.cc,v 1.41 2002/04/08 22:32:07 fluxgen Exp $ 25// $Id: Window.cc,v 1.42 2002/04/09 23:17:11 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -1952,8 +1952,8 @@ void FluxboxWindow::iconify(void) {
1952 1952
1953void FluxboxWindow::deiconify(bool reassoc, bool raise) { 1953void FluxboxWindow::deiconify(bool reassoc, bool raise) {
1954 if (iconic || reassoc) { 1954 if (iconic || reassoc) {
1955 screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), false); 1955 screen->reassociateWindow(this, screen->getCurrentWorkspace()->workspaceID(), false);
1956 } else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID()) 1956 } else if (workspace_number != screen->getCurrentWorkspace()->workspaceID())
1957 return; 1957 return;
1958 1958
1959 setState(NormalState); 1959 setState(NormalState);
@@ -2376,7 +2376,7 @@ void FluxboxWindow::stick(void) {
2376 stuck = false; 2376 stuck = false;
2377 2377
2378 if (! iconic) 2378 if (! iconic)
2379 screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), true); 2379 screen->reassociateWindow(this, screen->getCurrentWorkspace()->workspaceID(), true);
2380 2380
2381 2381
2382 } else { 2382 } else {
diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc
index 5846261..89956c3 100644
--- a/src/Windowmenu.cc
+++ b/src/Windowmenu.cc
@@ -21,7 +21,7 @@
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE. 22// DEALINGS IN THE SOFTWARE.
23 23
24// $Id: Windowmenu.cc,v 1.11 2002/04/08 22:35:16 fluxgen Exp $ 24// $Id: Windowmenu.cc,v 1.12 2002/04/09 23:19:02 fluxgen Exp $
25 25
26//use GNU extensions 26//use GNU extensions
27#ifndef _GNU_SOURCE 27#ifndef _GNU_SOURCE
@@ -239,7 +239,7 @@ void Windowmenu::SendtoWorkspacemenu::update(void) {
239 remove(0); 239 remove(0);
240 } 240 }
241 for (i = 0; i < windowmenu->screen->getCount(); ++i) 241 for (i = 0; i < windowmenu->screen->getCount(); ++i)
242 insert(windowmenu->screen->getWorkspace(i)->getName()); 242 insert(windowmenu->screen->getWorkspace(i)->name().c_str());
243 243
244 Basemenu::update(); 244 Basemenu::update();
245} 245}
diff --git a/src/Workspacemenu.cc b/src/Workspacemenu.cc
index ba4ff0a..a9b0b52 100644
--- a/src/Workspacemenu.cc
+++ b/src/Workspacemenu.cc
@@ -21,6 +21,8 @@
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE. 22// DEALINGS IN THE SOFTWARE.
23 23
24// $Id: Workspacemenu.cc,v 1.6 2002/04/09 23:19:17 fluxgen Exp $
25
24//use GNU extension 26//use GNU extension
25#ifndef _GNU_SOURCE 27#ifndef _GNU_SOURCE
26#define _GNU_SOURCE 28#define _GNU_SOURCE
@@ -63,7 +65,7 @@ void Workspacemenu::itemSelected(int button, unsigned int index) {
63 screen->addWorkspace(); 65 screen->addWorkspace();
64 else if (index == 1) 66 else if (index == 1)
65 screen->removeLastWorkspace(); 67 screen->removeLastWorkspace();
66 else if ((screen->getCurrentWorkspace()->getWorkspaceID() != 68 else if ((screen->getCurrentWorkspace()->workspaceID() !=
67 (index - 2)) && ((index - 2) < screen->getCount())) 69 (index - 2)) && ((index - 2) < screen->getCount()))
68 screen->changeWorkspaceID(index - 2); 70 screen->changeWorkspaceID(index - 2);
69 71
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index e0895d4..4d26daa 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.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: fluxbox.cc,v 1.48 2002/04/09 12:09:03 cout Exp $ 25// $Id: fluxbox.cc,v 1.49 2002/04/09 23:14:25 fluxgen Exp $
26 26
27//Use some GNU extensions 27//Use some GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -610,9 +610,8 @@ void Fluxbox::process_event(XEvent *e) {
610 610
611 if (iskdedockapp) { 611 if (iskdedockapp) {
612 XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask); 612 XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask);
613 std::list<BScreen *>::iterator it = screenList.begin(); 613 std::list<BScreen *>::iterator it = screenList.begin();
614 std::list<BScreen *>::iterator it_end = screenList.end(); 614 for (; (*it) == screenList.back(); ++it) {
615 for (; (*it) == screenList->last(); ++it) {
616 (*it)->getSlit()->addClient(e->xmaprequest.window); 615 (*it)->getSlit()->addClient(e->xmaprequest.window);
617 } 616 }
618 return; 617 return;
@@ -1850,8 +1849,8 @@ void Fluxbox::save_rc(void) {
1850 string workspaces_string(rc_string); 1849 string workspaces_string(rc_string);
1851 1850
1852 for (unsigned int workspace=0; workspace < screen->getCount(); workspace++) { 1851 for (unsigned int workspace=0; workspace < screen->getCount(); workspace++) {
1853 if (screen->getWorkspace(workspace)->getName()!=0) 1852 if (screen->getWorkspace(workspace)->name().size()!=0)
1854 workspaces_string.append(screen->getWorkspace(workspace)->getName()); 1853 workspaces_string.append(screen->getWorkspace(workspace)->name());
1855 else 1854 else
1856 workspaces_string.append("Null"); 1855 workspaces_string.append("Null");
1857 workspaces_string.append(","); 1856 workspaces_string.append(",");
@@ -2402,7 +2401,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) {
2402 old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber()); 2401 old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber());
2403 2402
2404 old_win->setFocusFlag(False); 2403 old_win->setFocusFlag(False);
2405 old_wkspc->getMenu()->setItemSelected(old_win->getWindowNumber(), False); 2404 old_wkspc->menu()->setItemSelected(old_win->getWindowNumber(), false);
2406 2405
2407 } 2406 }
2408 2407
@@ -2413,7 +2412,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) {
2413 wkspc = screen->getWorkspace(win->getWorkspaceNumber()); 2412 wkspc = screen->getWorkspace(win->getWorkspaceNumber());
2414 focused_window = win; 2413 focused_window = win;
2415 win->setFocusFlag(True); 2414 win->setFocusFlag(True);
2416 wkspc->getMenu()->setItemSelected(win->getWindowNumber(), True); 2415 wkspc->menu()->setItemSelected(win->getWindowNumber(), true);
2417 2416
2418 } else 2417 } else
2419 focused_window = (FluxboxWindow *) 0; 2418 focused_window = (FluxboxWindow *) 0;