]> Dogcows Code - chaz/openbox/blobdiff - src/Screen.cc
redecorating fixups. sync with bb cvs.
[chaz/openbox] / src / Screen.cc
index 159e2ae3ee5974d4c9f2995602cf1047f2e5cfb4..3b2b4cb9075b78de4c40a91722a8227f79f7437a 100644 (file)
@@ -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));
 }
This page took 0.024824 seconds and 4 git commands to generate.