vnc viewer problems

i got some problems with my vnc viewer
i can open and connect to vnc viewer
i run the terminal
i build a opencv code (from opencv 2.4.3 samples “squares”) and other opencv code
the problem is whenever i run opencv code (./squares) the new window opened behind the terminal window but i can’t move both of terminal or new window that show my running code
i can’t watch the progress from my opencv code
any suggestion what should i do?
i attached a picture show my vncviewer that stuck with terminal.
the only option left after i ran the code only close the terminal so i can use vncviewer again

please help me