Minor adjustment. Moving a window does not change its draft mode.

This commit is contained in:
Xinhao Yuan 2021-02-27 11:43:25 -05:00
parent 9d1487b6af
commit 88148f0dee
1 changed files with 17 additions and 13 deletions

View File

@ -209,6 +209,16 @@ function module.create(args_or_name, editor, default_cmd)
if areas == nil then return end
local nested_clients = {}
local function place_client_in_area(c, area)
if machi_editor.nested_layouts[areas[area].layout] ~= nil then
local clients = nested_clients[area]
if clients == nil then clients = {}; nested_clients[area] = clients end
clients[#clients + 1] = c
else
module.set_geometry(p.geometries[c], areas[area], areas[area], useless_gap, 0)
end
end
for i, c in ipairs(cls) do
if c.floating or c.immobilized then
log(DEBUG, "Ignore client " .. tostring(c))
@ -256,18 +266,17 @@ function module.create(args_or_name, editor, default_cmd)
end
if lu ~= nil and rd ~= nil then
if lu == rd and cd[c].draft ~= true then
cd[c].lu = nil
cd[c].rd = nil
p.geometries[c] = {}
if lu == rd and cd[c].lu == nil then
cd[c].area = lu
place_client_in_area(c, lu)
else
cd[c].lu = lu
cd[c].rd = rd
cd[c].area = nil
end
p.geometries[c] = {}
module.set_geometry(p.geometries[c], areas[lu], areas[rd], useless_gap, 0)
end
end
else
if cd[c].area ~= nil and
cd[c].area < #areas and
@ -283,13 +292,7 @@ function module.create(args_or_name, editor, default_cmd)
local area = find_area(c, areas)
cd[c].area, cd[c].lu, cd[c].rd = area, nil, nil
p.geometries[c] = {}
if machi_editor.nested_layouts[areas[area].layout] ~= nil then
local clients = nested_clients[area]
if clients == nil then clients = {}; nested_clients[area] = clients end
clients[#clients + 1] = c
else
module.set_geometry(p.geometries[c], areas[area], areas[area], useless_gap, 0)
end
place_client_in_area(c, area)
end
end
end
@ -434,15 +437,16 @@ function module.create(args_or_name, editor, default_cmd)
cd[c].lu = nil
cd[c].rd = nil
cd[c].area = lu
awful.layout.arrange(c.screen)
else
cd[c].lu = lu
cd[c].rd = rd
cd[c].area = nil
end
module.set_geometry(c, areas[lu], areas[rd], 0, c.border_width)
end
end
end
end
layout.name = args.icon_name or "machi"
layout.editor = args.editor