There will also be an ioctl() by which a background app can request to become the foreground app (if not already in the foreground). Hijack will do it's best to respect this, but the app cannot actually tell the difference.. This way Hijack could defer such actions when the user is in the midst of player menu navigation, for example.
Mmmm.. this still needs work.

Okay, how about: An app can request via ioctl() that it be placed in the foreground. This just sets an "activate me" bit in a data structure within Hijack. A similar ioctl() will exist to clear this bit, forcing the app to the background (or cancelling any prior request to be foregrounded).

The ioctl() always completes (returns) immediately, and Hijack will at some point attempt to "foreground" the app. When an app eventually DOES transition to foreground or background, it will receive a virtual button event indicating such.

Cheers