How do I make a non-fullscreen window on a different monitor?

I know I can call glfwSetWindowMonitor() and specify a monitor to make a fullscreen window on that monitor, and I know I can call glfwSetWindowMonitor() with NULL as the monitor to make it a windowed window. But when I do that it always moves the window back to the primary monitor. How do I keep it on the monitor I want?

This can be done by getting the position and size of the monitor and then moving the window there.

If you want to make sure your window does not overlap with any OS task/menu bars then you can use the glfwGetMonitorWorkarea function and then position the window within that.