summaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc42
1 files changed, 24 insertions, 18 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index fae0aff..45f9693 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -328,22 +328,12 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
328 renderPosWindow(); 328 renderPosWindow();
329 329
330 // setup workspaces and workspace menu 330 // setup workspaces and workspace menu
331 331 int nr_ws = *resource.workspaces;
332 if (*resource.workspaces != 0) { 332 addWorkspace(); // at least one
333 for (int i = 0; i < *resource.workspaces; ++i) { 333 for (int i = 1; i < nr_ws; ++i) {
334 Workspace *wkspc = new Workspace(*this, m_layermanager, 334 addWorkspace();
335 getNameOfWorkspace(m_workspaces_list.size()),
336 m_workspaces_list.size());
337 m_workspaces_list.push_back(wkspc);
338 }
339 } else { // create at least one workspace
340 Workspace *wkspc = new Workspace(*this, m_layermanager,
341 getNameOfWorkspace(m_workspaces_list.size()),
342 m_workspaces_list.size());
343 m_workspaces_list.push_back(wkspc);
344 } 335 }
345 336
346
347 m_current_workspace = m_workspaces_list.front(); 337 m_current_workspace = m_workspaces_list.front();
348 338
349 339
@@ -656,6 +646,7 @@ void BScreen::hideWindowMenus(const FluxboxWindow* except) {
656 646
657 647
658void BScreen::reconfigure() { 648void BScreen::reconfigure() {
649
659 m_windowtheme->setFocusedAlpha(*resource.focused_alpha); 650 m_windowtheme->setFocusedAlpha(*resource.focused_alpha);
660 m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha); 651 m_windowtheme->setUnfocusedAlpha(*resource.unfocused_alpha);
661 m_menutheme->setAlpha(*resource.menu_alpha); 652 m_menutheme->setAlpha(*resource.menu_alpha);
@@ -688,6 +679,18 @@ void BScreen::reconfigure() {
688 renderGeomWindow(); 679 renderGeomWindow();
689 renderPosWindow(); 680 renderPosWindow();
690 681
682 // realize the number of workspaces from the init-file
683 const int nr_ws = *resource.workspaces;
684 if (nr_ws > m_workspaces_list.size()) {
685 while(nr_ws != m_workspaces_list.size()) {
686 addWorkspace();
687 }
688 } else if (nr_ws < m_workspaces_list.size()) {
689 while(nr_ws != m_workspaces_list.size()) {
690 removeLastWorkspace();
691 }
692 }
693
691 //reconfigure menus 694 //reconfigure menus
692 m_workspacemenu->reconfigure(); 695 m_workspacemenu->reconfigure();
693 m_configmenu->reconfigure(); 696 m_configmenu->reconfigure();
@@ -851,11 +854,16 @@ void BScreen::setAntialias(bool value) {
851} 854}
852 855
853int BScreen::addWorkspace() { 856int BScreen::addWorkspace() {
857
858 bool save_name = getNameOfWorkspace(m_workspaces_list.size()) != "" ? false : true;
854 Workspace *wkspc = new Workspace(*this, m_layermanager, 859 Workspace *wkspc = new Workspace(*this, m_layermanager,
855 "", 860 getNameOfWorkspace(m_workspaces_list.size()),
856 m_workspaces_list.size()); 861 m_workspaces_list.size());
857 m_workspaces_list.push_back(wkspc); 862 m_workspaces_list.push_back(wkspc);
858 addWorkspaceName(wkspc->name().c_str()); // update names 863
864 if (save_name)
865 addWorkspaceName(wkspc->name().c_str()); //update names
866
859 saveWorkspaces(m_workspaces_list.size()); 867 saveWorkspaces(m_workspaces_list.size());
860 868
861 updateNetizenWorkspaceCount(); 869 updateNetizenWorkspaceCount();
@@ -879,8 +887,6 @@ int BScreen::removeLastWorkspace() {
879 //remove last workspace 887 //remove last workspace
880 m_workspaces_list.pop_back(); 888 m_workspaces_list.pop_back();
881 889
882
883
884 updateNetizenWorkspaceCount(); 890 updateNetizenWorkspaceCount();
885 saveWorkspaces(m_workspaces_list.size()); 891 saveWorkspaces(m_workspaces_list.size());
886 // must be deleted after we send notify!! 892 // must be deleted after we send notify!!