aboutsummaryrefslogtreecommitdiff
path: root/src/Gnome.cc
diff options
context:
space:
mode:
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) {