--
-- Copyright (c) Tuomo Valkonen 2004-2007.
--
--- Ion is free software; you can redistribute it and/or modify it under
--- the terms of the GNU Lesser General Public License as published by
--- the Free Software Foundation; either version 2.1 of the License, or
--- (at your option) any later version.
+-- See the included file LICENSE for details.
--
local ioncore=_G.ioncore
props={}
pcall(function() props=winprops[c][r][i] or {} end)
for idx, prop in ipairs_r(props) do
- if prop:match(cwin) then
+ if prop:match(cwin, id) then
if prop.oneshot then
table.remove(props, idx)
end
end
end
-local function do_add_winprop(class, role, instance, name, prop)
+local function do_add_winprop(class, role, instance, prop)
ensure_winproptab(class, role, instance)
table.insert(winprops[class][role][instance], prop)
end
--DOC
-- The basic name-based winprop matching criteria.
-function ioncore.match_winprop_name(prop, cwin)
- if not prop.name then
- return true
- else
+function ioncore.match_winprop_dflt(prop, cwin, id)
+ local function chkf(p, i)
+ if p==nil then
+ return true
+ else
+ return (p==(i and true))
+ -- hack for nil
+ end
+ end
+
+ if not chkf(prop.is_transient, id.is_transient) then
+ return false
+ end
+
+ if not chkf(prop.is_dockapp, id.is_dockapp) then
+ return false
+ end
+
+ if prop.name then
local nm=cwin:name()
if nm then
local st, en=string.find(nm, prop.name)
return false
end
end
+
+ return true
end
end
if not list2.match then
- list2.match=ioncore.match_winprop_name
+ list2.match=ioncore.match_winprop_dflt
end
- do_add_winprop(class, role, instance, name, list2)
+ do_add_winprop(class, role, instance, list2)
end