At 1241828865 time_t, Gregor Best wrote:
> For example, is it really neccessary to swap with each visible client? 
> Wouldn't
> swapping the client with the first slave client to the trick?

No, the purpose of the function is to put the client as the latest
slave, so this is the only way to do it.

But, if you move the array of ordered client to Lua, that'd be as simple
as:

local cl1idx, cl2idx
for k, v in ipairs(ordered_clients) do
    if v == c1 then
        cl1idx == k
    elseif v == c2 then
        cl2idx == k
    end
   if cl1idx and cl2 idx then break end
end

table.remove(ordered_clients, cl1idx)
table.remove(ordered_clients, cl2idx)
table.insert(ordered_clients, cl2idx, c1)
table.insert(ordered_clients, cl1idx, c2)
-- Call a hook for arranging the screen


No hook called, unless at the end. So that'd be a lot faster.

Cheers,
-- 
Julien Danjou
// ᐰ <jul...@danjou.info>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// Ferns will rule the world.

Attachment: signature.asc
Description: Digital signature

Reply via email to