[middle commit] setting position through setPosition method
Detecting window edges correctly