]> git.madduck.net Git - etc/awesome.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Fixes for the silly case where a client's borders are bigger than its allotted space
authorJosh Timmer <0ohexxo0@gmail.com>
Wed, 9 Sep 2015 00:19:55 +0000 (20:19 -0400)
committerJosh Timmer <0ohexxo0@gmail.com>
Wed, 9 Sep 2015 00:19:55 +0000 (20:19 -0400)
layout/cascade.lua
layout/cascadetile.lua
layout/centerfair.lua
layout/centerwork.lua
layout/termfair.lua

index a7c0032c6809310ceab0ddf3e879fae7c12cc023..3d7598b4c9380c3833424a7e9ff02d2c26ecf05c 100644 (file)
@@ -69,6 +69,8 @@ function cascade.arrange(p)
         g.y = wa.y + (i - 1) * cascade.offset_y
         g.width = wa.width - current_offset_x - 2*c.border_width
         g.height = wa.height - current_offset_y - 2*c.border_width
         g.y = wa.y + (i - 1) * cascade.offset_y
         g.width = wa.width - current_offset_x - 2*c.border_width
         g.height = wa.height - current_offset_y - 2*c.border_width
+        if g.width < 1 then g.width = 1 end
+        if g.height < 1 then g.height = 1 end
 
         c:geometry(g)
     end
 
         c:geometry(g)
     end
index b4fbc6569e347b800b78d27086b6df183ef654f5..3baf3e9809b37aa001471037d5b2edd3a5cf0d52 100644 (file)
@@ -141,6 +141,8 @@ function cascadetile.arrange(p)
                 g.width = g.width - useless_gap
             end
         end
                 g.width = g.width - useless_gap
             end
         end
+        if g.width < 1 then g.width = 1 end
+        if g.height < 1 then g.height = 1 end
         c:geometry(g)
 
         -- Remaining clients stacked in slave column, new ones on top.
         c:geometry(g)
 
         -- Remaining clients stacked in slave column, new ones on top.
@@ -161,6 +163,8 @@ function cascadetile.arrange(p)
                     g.x = g.x + useless_gap
                     g.y = g.y + useless_gap
                 end
                     g.x = g.x + useless_gap
                     g.y = g.y + useless_gap
                 end
+                if g.width < 1 then g.width = 1 end
+                if g.height < 1 then g.height = 1 end
                 c:geometry(g)
             end
         end
                 c:geometry(g)
             end
         end
index d84f4a664aca199ea887c3e6a0811a6dc1290bb1..50227264c2994786c022d1db75446ae50b3ae0f3 100644 (file)
@@ -77,6 +77,8 @@ function centerfair.arrange(p)
             local c = cls[i]
             g.width = width - 2*c.border_width
             g.height = wa.height - 2*useless_gap - 2*c.border_width
             local c = cls[i]
             g.width = width - 2*c.border_width
             g.height = wa.height - 2*useless_gap - 2*c.border_width
+            if g.width < 1 then g.width = 1 end
+            if g.height < 1 then g.height = 1 end
             g.x = offset_x + (i - 1) * (width + useless_gap)
             c:geometry(g)
         end
             g.x = offset_x + (i - 1) * (width + useless_gap)
             c:geometry(g)
         end
@@ -87,6 +89,8 @@ function centerfair.arrange(p)
         local g = {}
         g.width = wa.width - (num_x - 1)*width - (num_x + 1)*useless_gap - 2*c.border_width
         g.height = wa.height - 2*useless_gap - 2*c.border_width
         local g = {}
         g.width = wa.width - (num_x - 1)*width - (num_x + 1)*useless_gap - 2*c.border_width
         g.height = wa.height - 2*useless_gap - 2*c.border_width
+        if g.width < 1 then g.width = 1 end
+        if g.height < 1 then g.height = 1 end
         g.x = wa.x + useless_gap
         g.y = wa.y + useless_gap
 
         g.x = wa.x + useless_gap
         g.y = wa.y + useless_gap
 
@@ -139,6 +143,8 @@ function centerfair.arrange(p)
                 local c = cls[nclient]
                 g.height = height - 2*c.border_width
                 g.width = width - 2*c.border_width
                 local c = cls[nclient]
                 g.height = height - 2*c.border_width
                 g.width = width - 2*c.border_width
+                if g.width < 1 then g.width = 1 end
+                if g.height < 1 then g.height = 1 end
                 c:geometry(g)
                 nclient = nclient + 1
                 g.y = g.y + height + useless_gap
                 c:geometry(g)
                 nclient = nclient + 1
                 g.y = g.y + height + useless_gap
@@ -146,6 +152,8 @@ function centerfair.arrange(p)
             local c = cls[nclient]
             g.height = wa.height - (num_y[i] + 1)*useless_gap - (num_y[i] - 1)*height - 2*c.border_width
             g.width = width - 2*c.border_width
             local c = cls[nclient]
             g.height = wa.height - (num_y[i] + 1)*useless_gap - (num_y[i] - 1)*height - 2*c.border_width
             g.width = width - 2*c.border_width
+            if g.width < 1 then g.width = 1 end
+            if g.height < 1 then g.height = 1 end
             c:geometry(g)
             nclient = nclient + 1
             g.x = g.x + width + useless_gap
             c:geometry(g)
             nclient = nclient + 1
             g.x = g.x + width + useless_gap
index 1a45e2f4ba786308b4933e2675b78d8f3f4d44be..98a3ac253a02294a748e45cc654f4af2187b00d4 100644 (file)
@@ -60,6 +60,8 @@ function centerwork.arrange(p)
 
         g.height = wa.height - 2*useless_gap - 2*c.border_width
         g.width = mainwid - 2*c.border_width
 
         g.height = wa.height - 2*useless_gap - 2*c.border_width
         g.width = mainwid - 2*c.border_width
+        if g.width < 1 then g.width = 1 end
+        if g.height < 1 then g.height = 1 end
         g.x = wa.x + slaveLwid
         g.y = wa.y + useless_gap
 
         g.x = wa.x + slaveLwid
         g.y = wa.y + useless_gap
 
@@ -112,6 +114,8 @@ function centerwork.arrange(p)
                     g.height = slaveBhei - 2*useless_gap - 2*c.border_width
                 end
 
                     g.height = slaveBhei - 2*useless_gap - 2*c.border_width
                 end
 
+                if g.width < 1 then g.width = 1 end
+                if g.height < 1 then g.height = 1 end
                 c:geometry(g)
 
                 at = at + 1
                 c:geometry(g)
 
                 at = at + 1
index 6bb3e4049fdbf4053d3a163c4adca04c96ac1e4e..6aca99db900ddc15bb675a06ff617d425a7c2e87 100644 (file)
@@ -113,6 +113,8 @@ function termfair.arrange(p)
                 g.y = g.y + (this_y + 1)*useless_gap
 
             end
                 g.y = g.y + (this_y + 1)*useless_gap
 
             end
+            if g.width < 1 then g.width = 1 end
+            if g.height < 1 then g.height = 1 end
             c:geometry(g)
             remaining_clients = remaining_clients - 1
 
             c:geometry(g)
             remaining_clients = remaining_clients - 1