awful.client: use property for floating registering
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
fa9e31a2d4
commit
ee382dc5a8
|
@ -31,7 +31,6 @@ data.focus = {}
|
||||||
data.urgent = {}
|
data.urgent = {}
|
||||||
data.marked = {}
|
data.marked = {}
|
||||||
data.properties = otable()
|
data.properties = otable()
|
||||||
data.floating = otable()
|
|
||||||
|
|
||||||
-- Functions
|
-- Functions
|
||||||
urgent = {}
|
urgent = {}
|
||||||
|
@ -532,8 +531,8 @@ end
|
||||||
-- @param state True or false.
|
-- @param state True or false.
|
||||||
function floating.set(c, s)
|
function floating.set(c, s)
|
||||||
local c = c or capi.client.focus
|
local c = c or capi.client.focus
|
||||||
if c and data.floating[c] ~= s then
|
if c and property.get(c, "floating") ~= s then
|
||||||
data.floating[c] = s
|
property.set(c, "floating", s)
|
||||||
capi.hooks.arrange()(c.screen)
|
capi.hooks.arrange()(c.screen)
|
||||||
capi.hooks.property()(c, "floating")
|
capi.hooks.property()(c, "floating")
|
||||||
end
|
end
|
||||||
|
@ -564,8 +563,9 @@ end
|
||||||
function floating.get(c)
|
function floating.get(c)
|
||||||
local c = c or capi.client.focus
|
local c = c or capi.client.focus
|
||||||
if c then
|
if c then
|
||||||
if data.floating[c] ~= nil then
|
local value = property.get(c, "floating")
|
||||||
return data.floating[c]
|
if value ~= nil then
|
||||||
|
return value
|
||||||
end
|
end
|
||||||
if c.type ~= "normal"
|
if c.type ~= "normal"
|
||||||
or c.fullscreen
|
or c.fullscreen
|
||||||
|
@ -582,7 +582,7 @@ end
|
||||||
-- @param c A client.
|
-- @param c A client.
|
||||||
function floating.toggle(c)
|
function floating.toggle(c)
|
||||||
-- If it has been set to floating
|
-- If it has been set to floating
|
||||||
if data.floating[c] then
|
if property.get(c, "floating") then
|
||||||
floating.set(c, nil)
|
floating.set(c, nil)
|
||||||
else
|
else
|
||||||
floating.set(c, true)
|
floating.set(c, true)
|
||||||
|
|
Loading…
Reference in New Issue