summaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-07-19 14:38:10 +0000
committerDana Jansens <danakj@orodu.net>2002-07-19 14:38:10 +0000
commit256bcbed81015bafe8f89340e5cab9114c91b930 (patch)
tree5e1cdc33e09ee24f53e6f5831533edbbfe0c8fd4 /src/Screen.cc
parentf586e55a8cd3d740a1b7b3a0801bad27030926f9 (diff)
changing the number of workspaces in the rc does something without restarting now!
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 2887dc4d..81bf99ee 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -686,6 +686,23 @@ void BScreen::load_rc(void) {
}
+void BScreen::changeWorkspaceCount(unsigned int new_count) {
+ assert(new_count > 0);
+
+ if (new_count < workspacesList.size()) {
+ // shrink
+ for (unsigned int i = workspacesList.size(); i > new_count; --i)
+ removeLastWorkspace();
+ // removeLast already sets the current workspace to the
+ // last available one.
+ } else if (new_count > workspacesList.size()) {
+ // grow
+ for(unsigned int i = workspacesList.size(); i < new_count; ++i)
+ addWorkspace();
+ }
+}
+
+
void BScreen::reconfigure(void) {
// don't reconfigure while saving the initial rc file, it's a waste and it
// breaks somethings (workspace names)
@@ -696,6 +713,10 @@ void BScreen::reconfigure(void) {
slit->load_rc();
LoadStyle();
+ // we need to do this explicitly, because just loading this value from the rc
+ // does nothing
+ changeWorkspaceCount(resource.workspaces);
+
XGCValues gcv;
gcv.foreground = WhitePixel(blackbox->getXDisplay(),
getScreenNumber());