Maybe there is also a resize event you can listen for. Not sure.
Try to move that DisplaySize calculation out of the setupFunction to be sure it scaled correctly all the time.
eglQuerySurface(dpy, surface, EGL_WIDTH, &glWidth);
eglQuerySurface(dpy, surface, EGL_HEIGHT, &glHeight)...