focus_target(3)

πŸ“¦
version 0.7.1 Β· 2 versions
, in nixos 26.05

πŸ’… focus_target β€” scheduler bias era πŸ’…

okay so this is focus_target(3) from the Arcan Lua API, and she is short but she is important, fr fr. The whole point? Specify a frameserver the scheduler should try and bias. Let’s get into it, bestie 🫢


🌸 NAME 🌸

focus_target β€” Specify a frameserver the scheduler should try and bias.


✨ SYNOPSIS ✨

It starts with nil, and then the two call shapes are literally:

nil
focus_target( vid:WORLDID )
focus_target( vid:fsrv )

πŸ’– DESCRIPTION πŸ’–

okay so some synchronisation strategies might rely on a focus target β€” like some external process they want to bias in favor of. In those cases, the specific target has to be pointed out by the scripts themselves, because the engine has no direct way of knowing which client has visual focus and so on. That’s the whole vibe check this function handles: you use it to set such an object ✨

Calling the function without any arguments, or with WORLDID as the argument, will remove any existing bias focus. And if the frameserver expires, the bias will be removed implicitly β€” no extra cleanup arc, it’s just gone, periodt.


πŸŽ€ NOTES πŸŽ€

  • 1 β€” calling the function with a vid that is not tied to a frameserver is a terminal state transition. Highkey important: that’s a terminal state transition, not a cute little oopsie. Treat it with respect πŸ’€

πŸ¦‹ EXAMPLE πŸ¦‹

The example goes exactly like this, because code is sacred:

function focus_target0()
      local vid =
            target_alloc("test", function(source, status)
            end);
      if (valid_vid(vid, TYPE_FRAMESERVER)) then
            focus_target(vid);
      end
end

🌈 SEE ALSO 🌈

  • targetcontrol

okay bye bestie β€” that was focus_target(3) from the Arcan Lua API, dated October 2026 πŸ’–βœ¨

πŸ“¦ where this page comes from