]> Dogcows Code - chaz/openbox/blobdiff - src/Screen.cc
add next/prev window on all workspaces
[chaz/openbox] / src / Screen.cc
index 2887dc4d3f0d2fff8dbe3a00d16f8e19c6fc700c..ab7003ad2e6f556d928fdebf4102849ad75bc273 100644 (file)
@@ -21,7 +21,9 @@
 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 // DEALINGS IN THE SOFTWARE.
 
+#ifdef    HAVE_CONFIG_H
 #include "../config.h"
+#endif // HAVE_CONFIG_H
 
 extern "C" {
 #include <X11/Xatom.h>
@@ -686,6 +688,23 @@ void BScreen::load_rc(void) {
 }
 
 
+void BScreen::changeWorkspaceCount(unsigned int new_count) {
+  assert(new_count > 0);
+
+  if (new_count < workspacesList.size()) {
+    // shrink
+    for (unsigned int i = workspacesList.size(); i > new_count; --i)
+      removeLastWorkspace();
+    // removeLast already sets the current workspace to the 
+    // last available one.
+  } else if (new_count > workspacesList.size()) {
+    // grow
+    for(unsigned int i = workspacesList.size(); i < new_count; ++i)
+      addWorkspace();
+  }
+}
+
+
 void BScreen::reconfigure(void) {
   // don't reconfigure while saving the initial rc file, it's a waste and it
   // breaks somethings (workspace names)
@@ -696,6 +715,10 @@ void BScreen::reconfigure(void) {
   slit->load_rc();
   LoadStyle();
 
+  // we need to do this explicitly, because just loading this value from the rc
+  // does nothing
+  changeWorkspaceCount(resource.workspaces);
+
   XGCValues gcv;
   gcv.foreground = WhitePixel(blackbox->getXDisplay(),
                               getScreenNumber());
This page took 0.024811 seconds and 4 git commands to generate.