aboutsummaryrefslogtreecommitdiff
path: root/src/Gnome.cc
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2009-09-30 19:05:42 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2009-09-30 19:05:42 (GMT)
commit9cd953b2e11d0909375b9bd9cf4b9045b7c27729 (patch)
tree5abdf9bf93965d7de5a287cde200ac398ec32f55 /src/Gnome.cc
parentf8c61a1ba2cc5fc08690b89440cb2f0380f068df (diff)
downloadfluxbox-9cd953b2e11d0909375b9bd9cf4b9045b7c27729.zip
fluxbox-9cd953b2e11d0909375b9bd9cf4b9045b7c27729.tar.bz2
compile fix: ISO C++ forbids variable length array 'names'
Diffstat (limited to 'src/Gnome.cc')
-rw-r--r--src/Gnome.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc
index 79f7cf6..3b37e56 100644
--- a/src/Gnome.cc
+++ b/src/Gnome.cc
@@ -228,7 +228,7 @@ void Gnome::updateWorkspaceNames(BScreen &screen) {
228 size_t number_of_desks = screen.getWorkspaceNames().size(); 228 size_t number_of_desks = screen.getWorkspaceNames().size();
229 const BScreen::WorkspaceNames &workspace_names = screen.getWorkspaceNames(); 229 const BScreen::WorkspaceNames &workspace_names = screen.getWorkspaceNames();
230 // convert our desktop names to a char * so we can send it 230 // convert our desktop names to a char * so we can send it
231 char *names[number_of_desks]; 231 char** names = new char*[number_of_desks];
232 232
233 for (size_t i = 0; i < number_of_desks; i++) { 233 for (size_t i = 0; i < number_of_desks; i++) {
234 names[i] = new char[workspace_names[i].size() + 1]; 234 names[i] = new char[workspace_names[i].size() + 1];
@@ -238,13 +238,15 @@ void Gnome::updateWorkspaceNames(BScreen &screen) {
238 XTextProperty text; 238 XTextProperty text;
239 if (XStringListToTextProperty(names, number_of_desks, &text)) { 239 if (XStringListToTextProperty(names, number_of_desks, &text)) {
240 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), 240 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(),
241 &text, m_gnome_wm_win_workspace_names); 241 &text, m_gnome_wm_win_workspace_names);
242 XFree(text.value); 242 XFree(text.value);
243 } 243 }
244 244
245 // destroy name buffers 245 // destroy name buffers
246 for (size_t i = 0; i < number_of_desks; i++) 246 for (size_t i = 0; i < number_of_desks; i++)
247 delete [] names[i]; 247 delete[] names[i];
248
249 delete[] names;
248} 250}
249 251
250void Gnome::updateCurrentWorkspace(BScreen &screen) { 252void Gnome::updateCurrentWorkspace(BScreen &screen) {