shifty: don't spawn anything when moving window around

If a tag does not exist yet and we send a window it, it will be
created. However, we don't want to spawn anything at this point. Add an
argument to `getpos()` for that.
This commit is contained in:
Vincent Bernat 2014-01-01 09:05:25 +01:00
parent eb309fd35b
commit a47babf57e
2 changed files with 14 additions and 10 deletions

View file

@ -377,12 +377,14 @@ function set(t, args)
-- execute run/spawn
if awful.tag.getproperty(t, "initial") then
local spawn = args.spawn or preset.spawn or config.defaults.spawn
local run = args.run or preset.run or config.defaults.run
if spawn and args.matched ~= true then
awful.util.spawn_with_shell(spawn, scr)
if not args.nospawn then
local spawn = args.spawn or preset.spawn or config.defaults.spawn
local run = args.run or preset.run or config.defaults.run
if spawn and args.matched ~= true then
awful.util.spawn_with_shell(spawn, scr)
end
if run then run(t) end
end
if run then run(t) end
awful.tag.setproperty(t, "initial", nil)
end
@ -752,7 +754,7 @@ end
--getpos : returns a tag to match position
-- @param pos : the index to find
-- @return v : the tag (found or created) at position == 'pos'
function getpos(pos, scr_arg)
function getpos(pos, scr_arg, nospawn)
local v = nil
local existing = {}
local selected = nil
@ -794,7 +796,8 @@ function getpos(pos, scr_arg)
if j.position == pos then
v = add({name = i,
position = pos,
noswitch = not switch})
noswitch = true,
nospawn = nospawn})
end
end
end
@ -802,7 +805,8 @@ function getpos(pos, scr_arg)
-- not existing, not preconfigured
v = add({position = pos,
name = pos,
noswitch = not switch})
noswitch = true,
nospawn = nospawn})
end
return v
end