"n_events" went back from guint to gint.
Mainly fixes to properly differentiate between toplevel and offscreen windows, since these sometimes need different treatment. Furthermore, usage of gdk_window_get_effective_foo() instead of gdk_window_get_foo() where applicable.