How to get current screen size/resolution?

I am experiencing this bug as well. In standalone it just returns 0 for X and Y.