How to toggle normal/fullscreen?

What is the correct way to toggle between normal window and borderless fullscreen without loosing the context?

See the documentation on glfwSetWindowMonitor:

In particular the line:
To restore a window that was originally windowed to its original size and position, save these before making it full screen and then pass them in as above.

The OpenGL context will not be lost during these operations.

Thank you. I was saving the width/height but not the position.