X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FScreen.cc;h=3b2b4cb9075b78de4c40a91722a8227f79f7437a;hb=9ccebf111819c77108c179b906d824cb2a2a790d;hp=159e2ae3ee5974d4c9f2995602cf1047f2e5cfb4;hpb=b8ee3dbc4565efb19338c5cf1948f0f4e2f24fd6;p=chaz%2Fopenbox diff --git a/src/Screen.cc b/src/Screen.cc index 159e2ae3..3b2b4cb9 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -137,7 +137,7 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(bb, scrn) { xatom->setSupported(this); // set-up netwm support #ifdef HAVE_GETPID - xatom->setValue(getRootWindow(), XAtom::blackbox_pid, XAtom::Type_Cardinal, + xatom->setValue(getRootWindow(), XAtom::blackbox_pid, XAtom::cardinal, (unsigned long) getpid()); #endif // HAVE_GETPID @@ -230,10 +230,16 @@ BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(bb, scrn) { } saveWorkspaceNames(); + updateNetizenWorkspaceCount(); + workspacemenu->insert(i18n(IconSet, IconIcons, "Icons"), iconmenu); workspacemenu->update(); current_workspace = workspacesList.front(); + + xatom->setValue(getRootWindow(), XAtom::net_current_desktop, + XAtom::cardinal, 0); //first workspace + workspacemenu->setItemSelected(2, True); toolbar = new Toolbar(this); @@ -960,7 +966,7 @@ BlackboxWindow *BScreen::getIcon(unsigned int index) { unsigned int BScreen::addWorkspace(void) { Workspace *wkspc = new Workspace(this, workspacesList.size()); workspacesList.push_back(wkspc); - saveWorkspaces(getWorkspaceCount() + 1); + saveWorkspaces(getWorkspaceCount()); saveWorkspaceNames(); workspacemenu->insert(wkspc->getName(), wkspc->getMenu(), @@ -992,7 +998,7 @@ unsigned int BScreen::removeLastWorkspace(void) { workspacesList.pop_back(); delete wkspc; - saveWorkspaces(getWorkspaceCount() - 1); + saveWorkspaces(getWorkspaceCount()); saveWorkspaceNames(); toolbar->reconfigure(); @@ -1020,6 +1026,10 @@ void BScreen::changeWorkspaceID(unsigned int id) { current_workspace = getWorkspace(id); + xatom->setValue(getRootWindow(), XAtom::net_current_desktop, + XAtom::cardinal, id); + printf("%d\n", id); + workspacemenu->setItemSelected(current_workspace->getID() + 2, True); toolbar->redrawWorkspaceLabel(True); @@ -1114,6 +1124,9 @@ void BScreen::updateNetizenCurrentWorkspace(void) { void BScreen::updateNetizenWorkspaceCount(void) { + xatom->setValue(getRootWindow(), XAtom::net_number_of_desktops, + XAtom::cardinal, workspacesList.size()); + std::for_each(netizenList.begin(), netizenList.end(), std::mem_fun(&Netizen::sendWorkspaceCount)); }