tray.h cross platform fixes