make sure the desktop names atom is set when setting a workspace name, even when it doesnt already exist (bug fix)

This commit is contained in:
Dana Jansens 2002-07-14 17:30:26 +00:00
parent 8cb1108f4e
commit 8ff1b70973

View file

@ -71,6 +71,7 @@ Workspace::Workspace(BScreen *scrn, unsigned int i) {
lastfocus = (BlackboxWindow *) 0; lastfocus = (BlackboxWindow *) 0;
setName(""); setName("");
fprintf(stderr, "WORKSPACE NAME: %s\n", name.c_str());
} }
@ -435,12 +436,12 @@ void Workspace::setName(const string& new_name) {
XAtom::StringVect namesList; XAtom::StringVect namesList;
unsigned long numnames = (unsigned) -1; unsigned long numnames = (unsigned) -1;
if (xatom->getValue(screen->getRootWindow(), XAtom::net_desktop_names, if (xatom->getValue(screen->getRootWindow(), XAtom::net_desktop_names,
XAtom::utf8, numnames, namesList)) { XAtom::utf8, numnames, namesList) &&
if (namesList.size() > id) namesList.size() > id)
namesList[id] = name; namesList[id] = name;
else else
namesList.push_back(name); namesList.push_back(name);
}
xatom->setValue(screen->getRootWindow(), XAtom::net_desktop_names, xatom->setValue(screen->getRootWindow(), XAtom::net_desktop_names,
XAtom::utf8, namesList); XAtom::utf8, namesList);