awful.client.floating.toggle: Fix for dialogs

awful.client.floating.get() does some sensible defaults. E.g. dialogs are
floating by default. Since floating.toggle only checked the property, these
defaults made it break.

So floating.toggle() should use floating.get to decide if a given client is
floating. It should also use "false" instead of "nil" when the client is made
non-floating or else the default will apply again.

Thanks to vsp for making me figure this out. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2011-02-10 23:03:05 +01:00
parent dafcc68427
commit d8dc4bb2f5
1 changed files with 2 additions and 2 deletions

View File

@ -627,8 +627,8 @@ end
function floating.toggle(c) function floating.toggle(c)
local c = c or capi.client.focus local c = c or capi.client.focus
-- If it has been set to floating -- If it has been set to floating
if property.get(c, "floating") then if floating.get(c) then
floating.set(c, nil) floating.set(c, false)
else else
floating.set(c, true) floating.set(c, true)
end end