Replaced the size retrieving calls. Instead of getting the size of screen it gets the default screen size. Not really sure about the difference but it doesn't segfault like the other (experienced with python2 and 3 gobject). And I got the values for my screensize.
Divion with / is since python3 (although for python2.2+ available in __future__) true division. No need to change the type.