Does this actually work?

I would suspect you actually need to do something like:
int width;
int trash;
glfwGetWindowSize(window, &width, &trash);