summaryrefslogtreecommitdiff
path: root/src/Ewmh.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/Ewmh.cc
parentf8c61a1ba2cc5fc08690b89440cb2f0380f068df (diff)
downloadfluxbox_lack-9cd953b2e11d0909375b9bd9cf4b9045b7c27729.zip
fluxbox_lack-9cd953b2e11d0909375b9bd9cf4b9045b7c27729.tar.bz2
compile fix: ISO C++ forbids variable length array 'names'
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r--src/Ewmh.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 82653a5..4062595 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -822,7 +822,7 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) {
822 const BScreen::WorkspaceNames &workspacenames = screen.getWorkspaceNames(); 822 const BScreen::WorkspaceNames &workspacenames = screen.getWorkspaceNames();
823 const size_t number_of_desks = workspacenames.size(); 823 const size_t number_of_desks = workspacenames.size();
824 824
825 char *names[number_of_desks]; 825 char** names = new char*[number_of_desks];
826 826
827 for (size_t i = 0; i < number_of_desks; i++) { 827 for (size_t i = 0; i < number_of_desks; i++) {
828 names[i] = new char[workspacenames[i].size() + 1]; // +1 for \0 828 names[i] = new char[workspacenames[i].size() + 1]; // +1 for \0
@@ -844,13 +844,15 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) {
844#else 844#else
845 if (XStringListToTextProperty(names, number_of_desks, &text)) { 845 if (XStringListToTextProperty(names, number_of_desks, &text)) {
846 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), 846 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(),
847 &text, m_net->desktop_names); 847 &text, m_net->desktop_names);
848 XFree(text.value); 848 XFree(text.value);
849 } 849 }
850#endif 850#endif
851 851
852 for (size_t i = 0; i < number_of_desks; i++) 852 for (size_t i = 0; i < number_of_desks; i++)
853 delete [] names[i]; 853 delete[] names[i];
854
855 delete[] names;
854 856
855} 857}
856 858