Commits

Micah Nordland  committed 7a9b3ff

proper tag switching now implemented

  • Participants
  • Parent commits d0cf431

Comments (0)

Files changed (2)

File include/setup.h

         //of a config file. Maybe I'll use
         //a config.h
         int statusBarHeight = 20;
-        int numberOfTags = 2;
+        int numberOfTags = 3;
 
         Window& findWindow(xcb_window_t window);
         void addWindow(xcb_window_t window);

File src/setup.cpp

         {
             tag.windowContainer.focusWindow(win);
             monitor.currentTag = i;
+            std::cerr << "focusWindow setting currentTag to: " << monitor.currentTag << std::endl;
             return;
         }
 		i++;
 
 void Setup::layoutWindows()
 {
-    for (auto& monitor : monitors)
-        for (auto& tag : monitor.tagList)
-            tag.windowContainer.layoutWindows(monitor.area);
+    Monitor &monitor = getCurrentMonitor();
+    monitor.tagList.at(monitor.currentTag).windowContainer.layoutWindows(monitor.area);
 }
 
 Monitor& Setup::getCurrentMonitor()
 
 void Setup::nextTag()
 {
+    std::cerr << "nextTag"<< std::endl;
 	Monitor &monitor = getCurrentMonitor();
+    xcb_rectangle_t rect = monitor.area;
+    rect.x = 0 - rect.width;
+    rect.y = 0 - rect.height;
+    monitor.tagList.at(monitor.currentTag).windowContainer.layoutWindows(rect);
 	monitor.currentTag++;
-	std::cerr << "currentTag is: " << monitor.currentTag << std::endl;
 
 	if (monitor.currentTag > monitor.tagList.size()-1)
 		monitor.currentTag = 0;
-	monitor.tagList.at(monitor.currentTag).windowContainer.raiseAll();
+
+	std::cerr << "currentTag is: " << monitor.currentTag << std::endl;
+	//monitor.tagList.at(monitor.currentTag).windowContainer.raiseAll();
+    monitor.tagList.at(monitor.currentTag).windowContainer.layoutWindows(monitor.area);
 }
 
 void Setup::prevTag()
 {
+    std::cerr << "prevTag" << std::endl;
 	Monitor &monitor = getCurrentMonitor();
+    xcb_rectangle_t rect = monitor.area;
+    rect.x = 0 - rect.width;
+    rect.y = 0 - rect.height;
+    monitor.tagList.at(monitor.currentTag).windowContainer.layoutWindows(rect);
 	monitor.currentTag--;
 	if (monitor.currentTag < 0)
 	{
 		monitor.currentTag = monitor.tagList.size()-1;
 	}
-	monitor.tagList.at(monitor.currentTag).windowContainer.raiseAll();
+
+	std::cerr << "currentTag is: " << monitor.currentTag << std::endl;
+	//monitor.tagList.at(monitor.currentTag).windowContainer.raiseAll();
+    monitor.tagList.at(monitor.currentTag).windowContainer.layoutWindows(monitor.area);
+
 }
 
 void Setup::launchApp(std::string command)