diff options
author | mathias <mathias> | 2005-04-27 09:52:30 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-04-27 09:52:30 (GMT) |
commit | b97c3db25193c3b549e46910604d27e5ff92baa2 (patch) | |
tree | e0625ab80a5dd1f814e58d3d680cc78d9f5cc53b /src/fluxbox.cc | |
parent | 6df9d6ed54a299c0897cdd2d8aa380dc02b15a41 (diff) | |
download | fluxbox_pavel-b97c3db25193c3b549e46910604d27e5ff92baa2.zip fluxbox_pavel-b97c3db25193c3b549e46910604d27e5ff92baa2.tar.bz2 |
close #1182770
if someone changed the session.screen0.workspaces:<int> value and fired a
"reload config"/reconfigure-Command fluxbox crashed.
changes:
- cleaner way of reading in the workspacenames
- cleaner way of initialize the workspaces in BScreen()
- on BScreen::reconfigure we add/delete Workspaces to the
current screen until init-file and fluxbox are in sync
-> the user changed the initfile and pressed reload, so
imho he wants to have the changes in the init-file realized.
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 0865bc2..299207e 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -374,7 +374,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
374 | } | 374 | } |
375 | 375 | ||
376 | m_keyscreen = m_mousescreen = m_screen_list.front(); | 376 | m_keyscreen = m_mousescreen = m_screen_list.front(); |
377 | 377 | ||
378 | // setup theme manager to have our style file ready to be scanned | 378 | // setup theme manager to have our style file ready to be scanned |
379 | FbTk::ThemeManager::instance().load(FbTk::StringUtil::expandFilename(getStyleFilename())); | 379 | FbTk::ThemeManager::instance().load(FbTk::StringUtil::expandFilename(getStyleFilename())); |
380 | 380 | ||
@@ -388,7 +388,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile | |||
388 | 388 | ||
389 | m_resourcemanager.unlock(); | 389 | m_resourcemanager.unlock(); |
390 | ungrab(); | 390 | ungrab(); |
391 | 391 | ||
392 | #ifdef DEBUG | 392 | #ifdef DEBUG |
393 | if (m_resourcemanager.lockDepth() != 0) | 393 | if (m_resourcemanager.lockDepth() != 0) |
394 | cerr<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl; | 394 | cerr<<"--- resource manager lockdepth = "<<m_resourcemanager.lockDepth()<<endl; |
@@ -1568,22 +1568,18 @@ void Fluxbox::load_rc(BScreen &screen) { | |||
1568 | cerr<<__FILE__<<"("<<__FUNCTION__<<"): Workspaces="<< | 1568 | cerr<<__FILE__<<"("<<__FUNCTION__<<"): Workspaces="<< |
1569 | screen.getNumberOfWorkspaces()<<endl; | 1569 | screen.getNumberOfWorkspaces()<<endl; |
1570 | #endif // DEBUG | 1570 | #endif // DEBUG |
1571 | char *search = StringUtil::strdup(value.addr); | 1571 | string values(value.addr); |
1572 | 1572 | BScreen::WorkspaceNames names; | |
1573 | int i; | 1573 | |
1574 | for (i = 0; i < screen.getNumberOfWorkspaces(); i++) { | 1574 | StringUtil::removeTrailingWhitespace(values); |
1575 | char *nn; | 1575 | StringUtil::removeFirstWhitespace(values); |
1576 | 1576 | StringUtil::stringtok<BScreen::WorkspaceNames>(names, values, ","); | |
1577 | if (! i) nn = strtok(search, ","); | 1577 | BScreen::WorkspaceNames::iterator it; |
1578 | else nn = strtok(0, ","); | 1578 | for(it = names.begin(); it != names.end(); it++) { |
1579 | 1579 | if (!(*it).empty() && (*it) != "") | |
1580 | if (nn) | 1580 | screen.addWorkspaceName((*it).c_str()); |
1581 | screen.addWorkspaceName(nn); | ||
1582 | else break; | ||
1583 | |||
1584 | } | 1581 | } |
1585 | 1582 | ||
1586 | delete [] search; | ||
1587 | } | 1583 | } |
1588 | 1584 | ||
1589 | FbTk::Image::removeAllSearchPaths(); | 1585 | FbTk::Image::removeAllSearchPaths(); |