target_parent(3)
β¨ target_parent(3) β¨
okay so bestie, welcome to the Arcan Lua API page for target_parent β she's short, she's sweet, she's giving "small function, big job" energy π
and you're gonna get it in like two minutes flat, no cap.
π NAME π
target_parent β look up the frameserver VID of the parent of a subsegment. yes she's basically a "who's your mom" lookup for vids π
πΈ SYNOPSIS πΈ
vid
target_parent( vid )
that's the whole vibe: you hand her a vid, she hands you back a vid. simple. iconic. π¦
π DESCRIPTION π
so this function is your little detective π β you give her a specific vid and she figures out if that vid is a subsegment of a frameserver. if it is, she gives you the primary vid associated with that frameserver. literally that's it, that's the whole function, and honestly? she ate.
β NOTES β
- ok so fair warning bestie π β it is not guaranteed that the returned vid points to a valid frameserver or vid if the connection has been pacified</> or terminated externally</>. so like, don't just trust it blindly if things got weird, mmkay? π
π§ EXAMPLE π§
function target_parent0()
local a = target_alloc("test", function() end);
b = target_alloc(a, function() end);
if (target_parent(b) != a) then
shutdown("reported subsegment parent is invalid", -1);
else
shutdown("");
end
end
so here we allocate a, then allocate b as a subsegment of a, and then check β does target_parent(b) actually equal a? if not, we bail out with "reported subsegment parent is invalid" and -1. if it matches, we shutdown("") and vibe π
π EXAMPLE π
function target_parent1()
local a = target_alloc("test", function() end);
if (valid_vid(target_parent(a))) then
shutdown("connection point should not have a parent", -1);
else
shutdown("");
end
end
and this one is the β¨reverse testβ¨ β a here is a top-level connection point, so target_parent(a) should not be a valid vid. if valid_vid says it is, that's a problem and we shutdown("connection point should not have a parent", -1). otherwise, clean exit, no drama π
π₯ SEE ALSO π₯
targetcontrol
okay that's the whole page bestie, you're officially a target_parent expert π«Ά β this gem is from the Arcan Lua API, dated October 2026</>, and yes she's still filed under target_parent(3) in case you need to find her again π«
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms