Restore the ability to resize tiled clients.
This backport previously deleted code. The upstreamed solution was never merged, so better bring this back, even with the limitations.
This commit is contained in:
parent
bd4f3de7f1
commit
efdfc43d29
24
resize.lua
24
resize.lua
|
@ -24,6 +24,18 @@ local r_ajust = {
|
||||||
down = function(c, d) return { height = c.height + d, } end,
|
down = function(c, d) return { height = c.height + d, } end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Resize tiled using the keyboard
|
||||||
|
local layouts_all = {
|
||||||
|
[awful.layout.suit.floating] = { right = "" },
|
||||||
|
[awful.layout.suit.tile] = { right = {mwfact= 0.05}, left = {mwfact=-0.05}, up ={wfact=-0.1 }, down = {wfact = 0.1 } },
|
||||||
|
[awful.layout.suit.tile.left] = { right = {mwfact=-0.05}, left = {mwfact= 0.05}, up ={wfact= 0.1 }, down = {wfact =-0.1 } },
|
||||||
|
[awful.layout.suit.tile.bottom] = { right = {wfact=-0.1 }, left = {wfact= 0.1 }, up ={mwfact=-0.05}, down = {mwfact= 0.05} },
|
||||||
|
[awful.layout.suit.tile.top] = { right = {wfact=-0.1 }, left = {wfact= 0.1 }, up ={mwfact= 0.05}, down = {mwfact=-0.05} },
|
||||||
|
[awful.layout.suit.spiral] = { right = {wfact=-0.1 }, left = {wfact= 0.1 }, up ={mwfact= 0.05}, down = {mwfact=-0.05} },
|
||||||
|
[awful.layout.suit.magnifier] = { right = {mwfact= 0.05}, left = {mwfact=-0.05}, up ={mwfact= 0.05}, down = {mwfact=-0.05} },
|
||||||
|
-- The other layouts cannot be resized using variables
|
||||||
|
}
|
||||||
|
|
||||||
local function create_indicators()
|
local function create_indicators()
|
||||||
local ret = {}
|
local ret = {}
|
||||||
local angle = -((2*math.pi)/8)
|
local angle = -((2*math.pi)/8)
|
||||||
|
@ -132,7 +144,19 @@ function module.resize(mod,key,event,direction,is_swap,is_max)
|
||||||
local del = is_swap and -100 or 100
|
local del = is_swap and -100 or 100
|
||||||
direction = is_swap and invert[direction] or direction
|
direction = is_swap and invert[direction] or direction
|
||||||
|
|
||||||
|
local lay = awful.layout.get(c.screen)
|
||||||
|
|
||||||
|
if c.floating or lay == awful.layout.suit.floating then
|
||||||
c:emit_signal("request::geometry", "mouse.resize", r_ajust[direction](c, del))
|
c:emit_signal("request::geometry", "mouse.resize", r_ajust[direction](c, del))
|
||||||
|
elseif layouts_all[lay] then
|
||||||
|
local ret = layouts_all[lay][direction]
|
||||||
|
if ret.mwfact then
|
||||||
|
awful.tag.incmwfact(ret.mwfact)
|
||||||
|
end
|
||||||
|
if ret.wfact then
|
||||||
|
awful.client.incwfact(ret.wfact, c)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue