summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Ewmh.cc8
-rw-r--r--src/Gnome.cc8
2 files changed, 10 insertions, 6 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
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) {