fixes to pollevent, basic window management now works