lv2 / pugl

A minimal portable API for embeddable GUIs
https://gitlab.com/lv2/pugl/
ISC License
174 stars 34 forks source link

Adding pointer grab support #104

Open swesterfeld opened 11 months ago

swesterfeld commented 11 months ago

In some cases my SpectMorph plugin has the problem that the mouse pointer hits the border of the screen while the user would still want to drag further. For instance SpectMorph has sliders which support SHIFT+drag to do fine adjustment. In this case after the mouse click the mouse is moving much faster than the slider itself.

The best fix I can think of is for these cases grab & hide the mouse pointer so that it will not hit the border of the screen no matter how far the user drags the mouse from its original click point. I wonder if this would be a feature you would want to see added to pugl. If so, I can try to provide an API suggestion and at least an implementation for X11 as PR.

drobilla commented 11 months ago

Sure. I'm not sure about how the details should work, probably should check out what other things do (presumably it gets used a lot in glfw since the gamer types certainly need it), but it seems like something that should be there anyway. Moreso than some things I have reluctantly accepted, really 😄

A preliminary implementation for X11 would be great, thanks. I can hopefully make the same thing work on Windows and MacOS easily enough.