Xlib provides functions that you can use to set and get the input focus.
The input focus is a shared resource, and cooperation among clients is
required for correct interaction. See the
Inter-Client Communication Conventions Manual
for input focus policy.