client: Support property fallback

This commit is contained in:
Emmanuel Lepage Vallee 2016-03-13 03:44:19 -04:00
parent e0897cf170
commit 89a1dab845
1 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,7 @@
-- Grab environment we need
local util = require("awful.util")
local spawn = require("awful.spawn")
local object = require("gears.object")
local tag = require("awful.tag")
local pairs = pairs
local type = type
@ -1102,6 +1103,7 @@ capi.client.add_signal("marked")
capi.client.add_signal("unmarked")
capi.client.connect_signal("focus", client.focus.history.add)
-- Add clients during startup to focus history.
-- This used to happen through ewmh.activate, but that only handles visible
-- clients now.
@ -1121,6 +1123,14 @@ capi.client.connect_signal("unmanage", client.floating.delete)
-- Register persistent properties
client.property.persist("floating", "boolean")
-- Extend the luaobject
object.properties(capi.client, {
getter_class = client,
setter_class = client,
getter_fallback = client.property.get,
setter_fallback = client.property.set,
})
return client
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80