I've been programming in Linux for years but don't have too much knowledge in the perspective of display. Now I'm asked to write a separate process that will monitor which window (probably not the window created by my process) is focused by the user and do some simple manipulations such as move and resize.
Is it possible? Is there a general way to achieve that? Can someone give any hint I can look into? Thanks!
Use xdotool. It can emulate keystrokes, mouse-actions, find active windows etc.
Example: Run this command in your (non maximized) terminal window and it will jump 10 pixels down and to the right:
xdotool windowmove --relative $(xdotool getwindowfocus) 10 10
It should be available in most distributions, ie sudo apt-get install xdotool
or similar for other package managers.