if you have the time for it, jgpaiva, then rather than trying to fix the restore problem, could you perhaps try implementing this workaround idea...
instead of the window correctly restoring to its original position, instead, could it move its title bar so that it was positioned under the mouse cursor.
in other words. you move the window to the 'restore' zone. the window changes size to the correct 'restore' size. the window then positions itself so that the titlebar rests under the mouse cursor - the mouse cursor will be somewhere inside the 'restore' zone area, of course.
this way it's just a case of dragging the titlebar/window back to the position on screen that you would like it to be.
like i mentioned before, i'm quite happy with how things are working at the moment anyway. these are just ideas.