The window operator will track focus and direct input according to its configuration. If your window manager decides to send input to another program because it provides a focus change, you're out of luck.
While the program lacks focus, if it could receive mouse and keyboard events, this would be a serious security hole. In principle, any small inconspicuous background program can track the entire system, possibly even stealing passwords in this process.
Your only hope is to find an option in your window manager that will allow you to minimize the program without changing focus. Of course, everything you type will go only according to the minimized program (and does not affect the rest of the system).
Another method (by no means guaranteed) is a program for detecting minimization events and requesting focus in the minimization event handler. Note that doing this is possible (if I were writing a window manager) unminimize the window.
source
share