aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-12 15:19:22 (GMT)
committerfluxgen <fluxgen>2003-12-12 15:19:22 (GMT)
commit30957f197cbd377733852814e9012a557f3180c8 (patch)
tree6670d46748d245c4e816e446994eef2e1d48a774 /src
parentdb6bdb2a6ff44aaf84eb49728d7952de0c49f35e (diff)
downloadfluxbox-30957f197cbd377733852814e9012a557f3180c8.zip
fluxbox-30957f197cbd377733852814e9012a557f3180c8.tar.bz2
fixed bug in adding new workspaces
Diffstat (limited to 'src')
-rw-r--r--src/Ewmh.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 5924203..c2b6203 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.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: Ewmh.cc,v 1.33 2003/09/23 13:52:05 rathnor Exp $ 22// $Id: Ewmh.cc,v 1.34 2003/12/12 15:19:22 fluxgen Exp $
23 23
24#include "Ewmh.hh" 24#include "Ewmh.hh"
25 25
@@ -212,15 +212,17 @@ void Ewmh::updateClientList(BScreen &screen) {
212 212
213void Ewmh::updateWorkspaceNames(BScreen &screen) { 213void Ewmh::updateWorkspaceNames(BScreen &screen) {
214 XTextProperty text; 214 XTextProperty text;
215 const size_t number_of_desks = screen.getWorkspaceNames().size(); 215 const BScreen::WorkspaceNames &workspacenames = screen.getWorkspaceNames();
216 const size_t number_of_desks = workspacenames.size();
216 217
217 char *names[number_of_desks]; 218 char *names[number_of_desks];
218 219
219 for (size_t i = 0; i < number_of_desks; i++) { 220 for (size_t i = 0; i < number_of_desks; i++) {
220 names[i] = new char[screen.getWorkspaceNames()[i].size()]; 221 names[i] = new char[workspacenames[i].size() + 1]; // +1 for \0
221 strcpy(names[i], screen.getWorkspaceNames()[i].c_str()); 222 memset(names[i], 0, workspacenames[i].size());
223 strcpy(names[i], workspacenames[i].c_str());
222 } 224 }
223 225
224 if (XStringListToTextProperty(names, number_of_desks, &text)) { 226 if (XStringListToTextProperty(names, number_of_desks, &text)) {
225 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), 227 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(),
226 &text, m_net_desktop_names); 228 &text, m_net_desktop_names);