summaryrefslogtreecommitdiff
path: root/src/Ewmh.cc
diff options
context:
space:
mode:
authorJim Ramsay <i.am@jimramsay.com>2009-10-14 01:05:49 (GMT)
committerJim Ramsay <i.am@jimramsay.com>2009-10-14 01:05:49 (GMT)
commit839ea523164caecd8c779e60539b78c2a748a81f (patch)
tree0019d04f27a1a258bc7a900e3cf77b916dca6493 /src/Ewmh.cc
parent4d3aa646c1d1d1de4fdb31f938f6ea62fd5dd21e (diff)
parent8def80cec337a986b762cdbb5e2555c6da809353 (diff)
downloadfluxbox_lack-argb.zip
fluxbox_lack-argb.tar.bz2
Merge branch 'master' into argbtesting/argbargb
Conflicts: src/FbTk/FbWindow.cc
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r--src/Ewmh.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index b64a95d..fb1b832 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -39,15 +39,24 @@
39 39
40#include <X11/Xproto.h> 40#include <X11/Xproto.h>
41#include <X11/Xatom.h> 41#include <X11/Xatom.h>
42
42#include <iostream> 43#include <iostream>
43#include <algorithm> 44#include <algorithm>
44#include <new> 45#include <new>
46
45#ifdef HAVE_CSTRING 47#ifdef HAVE_CSTRING
46 #include <cstring> 48 #include <cstring>
47#else 49#else
48 #include <string.h> 50 #include <string.h>
49#endif 51#endif
50 52
53#ifdef HAVE_CSTDLIB
54 #include <cstdlib>
55#else
56 #include <stdlib.h>
57#endif
58
59
51using std::cerr; 60using std::cerr;
52using std::endl; 61using std::endl;
53using std::vector; 62using std::vector;
@@ -288,7 +297,7 @@ void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
288 winclient.setIcon(icon); 297 winclient.setIcon(icon);
289} 298}
290 299
291}; // end anonymous namespace 300} // end anonymous namespace
292 301
293class Ewmh::EwmhAtoms { 302class Ewmh::EwmhAtoms {
294public: 303public:
@@ -822,7 +831,7 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) {
822 const BScreen::WorkspaceNames &workspacenames = screen.getWorkspaceNames(); 831 const BScreen::WorkspaceNames &workspacenames = screen.getWorkspaceNames();
823 const size_t number_of_desks = workspacenames.size(); 832 const size_t number_of_desks = workspacenames.size();
824 833
825 char *names[number_of_desks]; 834 char** names = new char*[number_of_desks];
826 835
827 for (size_t i = 0; i < number_of_desks; i++) { 836 for (size_t i = 0; i < number_of_desks; i++) {
828 names[i] = new char[workspacenames[i].size() + 1]; // +1 for \0 837 names[i] = new char[workspacenames[i].size() + 1]; // +1 for \0
@@ -844,13 +853,15 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) {
844#else 853#else
845 if (XStringListToTextProperty(names, number_of_desks, &text)) { 854 if (XStringListToTextProperty(names, number_of_desks, &text)) {
846 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), 855 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(),
847 &text, m_net->desktop_names); 856 &text, m_net->desktop_names);
848 XFree(text.value); 857 XFree(text.value);
849 } 858 }
850#endif 859#endif
851 860
852 for (size_t i = 0; i < number_of_desks; i++) 861 for (size_t i = 0; i < number_of_desks; i++)
853 delete [] names[i]; 862 delete[] names[i];
863
864 delete[] names;
854 865
855} 866}
856 867
@@ -1535,3 +1546,4 @@ void Ewmh::updateFrameExtents(FluxboxWindow &win) {
1535 (unsigned char *)extents, 4); 1546 (unsigned char *)extents, 4);
1536 } 1547 }
1537} 1548}
1549