2 -- ion/share/ioncore_quasiact.lua -- Frame quasiactivation support
4 -- Copyright (c) Tuomo Valkonen 2007-2009.
6 -- See the included file LICENSE for details.
12 local function quasi_activated(frame
, src
)
13 local old
=qa_source
[frame
]
19 ioncore
.defer(function() frame
:set_grattr("quasiactive", "set") end)
22 local function quasi_inactivated(frame
, src
)
25 ioncore
.defer(function() frame
:set_grattr("quasiactive", "unset") end)
28 local function activated(src
)
29 local tgt
=src
:__return_target()
30 if obj_is(tgt
, "WFrame") then
31 quasi_activated(tgt
, src
)
32 elseif obj_is(tgt
, "WGroup") then
33 local mgr
=tgt
:manager()
34 if obj_is(mgr
, "WFrame") then
35 quasi_activated(mgr
, src
)
40 local function inactivated(src
)
41 local tgt
=qa_target
[src
]
43 quasi_inactivated(tgt
, src
)
48 local function deinit(tgt
)
49 local src
=qa_source
[tgt
]
56 local function quasiact_notify(reg
, how
)
57 if how
=="activated" or how
=="pseudoactivated" then
59 elseif how
=="inactivated" or how
=="pseudoinactivated" then
61 elseif how
=="set_return" then
62 if reg
:is_active(true--[[pseudoact--]]) then
65 elseif how
=="unset_return" then
67 elseif how
=="deinit" then
74 ioncore
.get_hook("region_notify_hook"):add(quasiact_notify
)