Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS: after FocusInEvent a second mouse press is required to receive ButtonPressEvent #128

Open
hzwar opened this issue Jan 25, 2025 · 3 comments

Comments

@hzwar
Copy link

hzwar commented Jan 25, 2025

This behaviour is standard on MacOS but for VSTs and AUs the most common behaviour (incl. Logic) is to allow for this use case:

  • DAW window or some other plugin window has focus
  • User hovers over plugin controls and sees hover state related indications - this works i.e. MotionEvent received
  • User presses mouse on a knob in a Pugl plugin window (ButtonPressEvent) and can immediately drag it (MotionEvents). The first part doesn't work, the ButtonPressEvent is not received. User needs to release mouse button and press it again.

Tried a workaround via FocusInEvent which is received but this lacks information like position and button. But even if that information would be avialble the workaround would not work because MotionEvent(s) don't come through until mouse button release/press.

@drobilla
Copy link
Collaborator

drobilla commented Feb 4, 2025

Presumably you can figure out how those VSTs and AUs do it. My guess is grabbing focus...

I don't really care about this to be honest, so I won't be looking into it myself, but I'd be happy to include any reasonable changes necessary to make workaround possible.

@falkTX
Copy link
Contributor

falkTX commented Feb 4, 2025

I think this is just a flag on the NSView component, saying that it "accepts first click".

https://stackoverflow.com/questions/19554185/how-to-make-a-nsview-get-focus-first-responder-immediately-to-accept-a-mousedown

I didnt try this myself though, but looks to be the thing needed here

@drobilla
Copy link
Collaborator

drobilla commented Feb 4, 2025

Oh, I vaguely remember seeing those words somewhere. Seems easy enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants