Generate an error if redeclaring a variable as a function

  Previously it would trigger an assertion or have undefined
behavior if compiled with -DNDEBUG.
Automatically update window_t fields when moved or resized.

  This is implemented when translating events, so that user code does not
need to create extra variables to keep track of the current window
position and dimensions, because the window_t fields would have incorrect
values.