awful.client: floating.toggle() reset auto detection (FS#429)

This is better than doing nil -> true -> false -> true...
We do nil -> true -> nil -> true.

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-01-14 14:55:56 +01:00
parent 4fdd239500
commit 34f6321e8f
1 changed files with 8 additions and 3 deletions

View File

@ -524,7 +524,7 @@ function getmarked()
return t
end
--- Set a client floating state.
--- Set a client floating state, overriding auto-detection.
-- Floating client are not handled by tiling layouts.
-- @param c A client.
-- @param state True or false.
@ -576,10 +576,15 @@ function floating.get(c)
end
end
--- Toggle the floating state of a client.
--- Toggle the floating state of a client between 'auto' and 'true'.
-- @param c A client.
function floating.toggle(c)
floating.set(c, not floating.get(c))
-- If it has been set to floating
if data.floating[c] then
floating.set(c, nil)
else
floating.set(c, true)
end
end
--- Remove the floating information on a client.