aboutsummaryrefslogtreecommitdiff
path: root/src/Gnome.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-06-12 14:28:00 (GMT)
committerfluxgen <fluxgen>2003-06-12 14:28:00 (GMT)
commite9ae291109cc44d86b53875a65470a6f34a32aef (patch)
tree3036933a1dbf99ae2cb8d40c6c611fdda27cb48b /src/Gnome.cc
parent603b784efd1db88ed1432bcd3b149b45d3b51e89 (diff)
downloadfluxbox-e9ae291109cc44d86b53875a65470a6f34a32aef.zip
fluxbox-e9ae291109cc44d86b53875a65470a6f34a32aef.tar.bz2
using desktop names
Diffstat (limited to 'src/Gnome.cc')
-rw-r--r--src/Gnome.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/Gnome.cc b/src/Gnome.cc
index bafcd78..6eef315 100644
--- a/src/Gnome.cc
+++ b/src/Gnome.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Gnome.cc,v 1.25 2003/05/19 22:40:40 fluxgen Exp $ 22// $Id: Gnome.cc,v 1.26 2003/06/12 14:28:00 fluxgen Exp $
23 23
24#include "Gnome.hh" 24#include "Gnome.hh"
25 25
@@ -61,6 +61,7 @@ void Gnome::initForScreen(BScreen &screen) {
61 m_gnome_wm_supporting_wm_check, 61 m_gnome_wm_supporting_wm_check,
62 XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); 62 XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1);
63 63
64 // supported gnome atoms
64 Atom gnomeatomlist[] = { 65 Atom gnomeatomlist[] = {
65 m_gnome_wm_supporting_wm_check, 66 m_gnome_wm_supporting_wm_check,
66 m_gnome_wm_win_workspace_names, 67 m_gnome_wm_win_workspace_names,
@@ -69,7 +70,6 @@ void Gnome::initForScreen(BScreen &screen) {
69 m_gnome_wm_win_hints, 70 m_gnome_wm_win_hints,
70 m_gnome_wm_win_layer 71 m_gnome_wm_win_layer
71 }; 72 };
72
73 //list atoms that we support 73 //list atoms that we support
74 screen.rootWindow().changeProperty(m_gnome_wm_prot, 74 screen.rootWindow().changeProperty(m_gnome_wm_prot,
75 XA_ATOM, 32, PropModeReplace, 75 XA_ATOM, 32, PropModeReplace,
@@ -143,7 +143,7 @@ void Gnome::updateClientList(BScreen &screen) {
143 143
144 Window *wl = new (nothrow) Window[num]; 144 Window *wl = new (nothrow) Window[num];
145 if (wl == 0) { 145 if (wl == 0) {
146 cerr<<"Fatal: Out of memory, can't allocate for gnome client list"<<endl; 146 cerr<<"Fatal: Out of memory, can't allocate ("<<num*sizeof (Window)<<") for gnome client list"<<endl;
147 return; 147 return;
148 } 148 }
149 149
@@ -180,24 +180,25 @@ void Gnome::updateClientList(BScreen &screen) {
180} 180}
181 181
182void Gnome::updateWorkspaceNames(BScreen &screen) { 182void Gnome::updateWorkspaceNames(BScreen &screen) {
183 XTextProperty text; 183
184 int number_of_desks = screen.getWorkspaceNames().size(); 184 int number_of_desks = screen.getWorkspaceNames().size();
185 185 const BScreen::WorkspaceNames &workspace_names = screen.getWorkspaceNames();
186 char s[1024]; 186 // convert our desktop names to a char * so we can send it
187 char *names[number_of_desks]; 187 char *names[number_of_desks];
188 188
189 for (int i = 0; i < number_of_desks; i++) { 189 for (int i = 0; i < number_of_desks; i++) {
190 sprintf(s, "Desktop %i", i); 190 names[i] = new char[workspace_names[i].size() + 1];
191 names[i] = new char[strlen(s) + 1]; 191 strcpy(names[i], workspace_names[i].c_str());
192 strcpy(names[i], s);
193 } 192 }
194 193
194 XTextProperty text;
195 if (XStringListToTextProperty(names, number_of_desks, &text)) { 195 if (XStringListToTextProperty(names, number_of_desks, &text)) {
196 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), 196 XSetTextProperty(FbTk::App::instance()->display(), screen.rootWindow().window(),
197 &text, m_gnome_wm_win_workspace_names); 197 &text, m_gnome_wm_win_workspace_names);
198 XFree(text.value); 198 XFree(text.value);
199 } 199 }
200 200
201 // destroy name buffers
201 for (int i = 0; i < number_of_desks; i++) 202 for (int i = 0; i < number_of_desks; i++)
202 delete [] names[i]; 203 delete [] names[i];
203} 204}