I wouldn’t call it a ‘trick’ - it is a robust and workable approach.
I have submitted an issue for this:
However I am unsure adding to the GLFW API for this is a good idea given that there are other, perhaps better, solutions.