Bugfix for spiral layout: avoid gaps between windows

(upstream git commit 94a8c725968535fd74fe399846f193ecc6ce4c29)
This commit is contained in:
dcoppa 2014-01-29 08:42:48 +00:00
parent 80515eaa65
commit 1f7648f63a
2 changed files with 65 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.73 2014/01/21 14:30:30 dcoppa Exp $ # $OpenBSD: Makefile,v 1.74 2014/01/29 08:42:48 dcoppa Exp $
COMMENT= highly configurable framework window manager COMMENT= highly configurable framework window manager
DISTNAME= awesome-3.5.2 DISTNAME= awesome-3.5.2
REVISION= 2 REVISION= 3
EXTRACT_SUFX= .tar.xz EXTRACT_SUFX= .tar.xz
CATEGORIES= x11 CATEGORIES= x11
@ -69,6 +69,7 @@ pre-configure:
post-install: post-install:
@rm ${WRKINST}/${LOCALBASE}/share/awesome/lib/*.{beforesubst,orig} \ @rm ${WRKINST}/${LOCALBASE}/share/awesome/lib/*.{beforesubst,orig} \
${WRKINST}/${LOCALBASE}/share/awesome/lib/awful/*.{beforesubst,orig} \ ${WRKINST}/${LOCALBASE}/share/awesome/lib/awful/*.{beforesubst,orig} \
${WRKINST}/${LOCALBASE}/share/awesome/lib/awful/layout/suit/*.orig \
${WRKINST}/${LOCALBASE}/share/awesome/lib/awful/widget/*.orig \ ${WRKINST}/${LOCALBASE}/share/awesome/lib/awful/widget/*.orig \
${WRKINST}/${LOCALBASE}/share/awesome/lib/menubar/*.{beforesubst,orig} \ ${WRKINST}/${LOCALBASE}/share/awesome/lib/menubar/*.{beforesubst,orig} \
${WRKINST}/${LOCALBASE}/share/awesome/themes/default/*.{beforesubst,orig} ${WRKINST}/${LOCALBASE}/share/awesome/themes/default/*.{beforesubst,orig}

View File

@ -0,0 +1,62 @@
$OpenBSD: patch-lib_awful_layout_suit_spiral_lua_in,v 1.1 2014/01/29 08:42:48 dcoppa Exp $
Bugfix for spiral layout: avoid gaps between windows
(upstream git commit 94a8c725968535fd74fe399846f193ecc6ce4c29)
--- lib/awful/layout/suit/spiral.lua.in.orig Sat Oct 12 18:48:49 2013
+++ lib/awful/layout/suit/spiral.lua.in Wed Jan 29 09:08:04 2014
@@ -7,6 +7,7 @@
-- Grab environment we need
local ipairs = ipairs
+local math = math
-- awful.layout.suit.spiral
local spiral = {}
@@ -15,28 +16,35 @@ local function do_spiral(p, _spiral)
local wa = p.workarea
local cls = p.clients
local n = #cls
+ local old_width, old_height = wa.width, 2 * wa.height
for k, c in ipairs(cls) do
- if k < n then
- if k % 2 == 0 then
- wa.height = wa.height / 2
- else
- wa.width = wa.width / 2
+ if k % 2 == 0 then
+ wa.width, old_width = math.ceil(old_width / 2), wa.width
+ if k ~= n then
+ wa.height, old_height = math.floor(wa.height / 2), wa.height
end
+ else
+ wa.height, old_height = math.ceil(old_height / 2), wa.height
+ if k ~= n then
+ wa.width, old_width = math.floor(wa.width / 2), wa.width
+ end
end
if k % 4 == 0 and _spiral then
wa.x = wa.x - wa.width
- elseif k % 2 == 0 or
- (k % 4 == 3 and k < n and _spiral) then
- wa.x = wa.x + wa.width
+ elseif k % 2 == 0 then
+ wa.x = wa.x + old_width
+ elseif k % 4 == 3 and k < n and _spiral then
+ wa.x = wa.x + math.ceil(old_width / 2)
end
if k % 4 == 1 and k ~= 1 and _spiral then
wa.y = wa.y - wa.height
- elseif k % 2 == 1 and k ~= 1 or
- (k % 4 == 0 and k < n and _spiral) then
- wa.y = wa.y + wa.height
+ elseif k % 2 == 1 and k ~= 1 then
+ wa.y = wa.y + old_height
+ elseif k % 4 == 0 and k < n and _spiral then
+ wa.y = wa.y + math.ceil(old_height / 2)
end
local g = {