Moves the keyboard focus to the window, relative to its top-level window. If the focus is in the window's top-level window, then the focus is immediately moved to this window. Otherwise, the focus is not immediately moved, but when the window's top-level window gets the keyboard focus, it is delegated to this window.
See also on-focus.
Note that under X, keyboard focus can move to the menu bar when the user is selecting a menu item.
The current keyboard focus window can be changed by the user, and such changes do not go through this method; use on-focus to monitor focus changes.