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] [gain_gui] Wrong Cursor Position #1

Closed
apalm opened this issue Feb 26, 2022 · 5 comments
Closed

[macOS] [gain_gui] Wrong Cursor Position #1

apalm opened this issue Feb 26, 2022 · 5 comments

Comments

@apalm
Copy link
Contributor

apalm commented Feb 26, 2022

OS: macOS 12.2.1
DAW: REAPER 6.49

First of all, thank you for building this framework. It looks very cool.

I wanted to try out gain_gui, so I built it using cargo xtask bundle gain_gui --release --bundle-vst3, then copied target/gain_gui.vst3 to /Library/Audio/Plug-Ins/VST3.

While the plugin works, the cursor position appears to be off. This is most obvious with the slider, which isn't draggable unless I drag on a specific spot below the handle. Maybe a scaling issue?

Screen.Recording.2022-02-25.at.18.28.20.mov

I understand that this stuff hasn't been tested on macOS, so feel free to close this issue if it's not actionable :)

@robbert-vdh
Copy link
Owner

I don't have a Mac to test this on, but presumably this is baseview not translating the coordinates correctly (these lines in the original upstream baseview). REAPER embeds the parent window into another top level window, and from the screenshot it looks like the mouse coordinates used by baseview are relative to some part of that top level window, and not to the parent window passed to the plugin. Have you created a ticket on the baseview repo for this yet? egui-baseview just passes through the mouse coordinates as provided by baseview, so the issue has to be on baseview's side.

@apalm
Copy link
Contributor Author

apalm commented Feb 27, 2022

I see. No, I've not created a ticket; will create a minimal repro and do so. Thank you!

@apalm apalm closed this as completed Feb 27, 2022
@apalm
Copy link
Contributor Author

apalm commented Feb 27, 2022

So, while creating my minimal repro, I noticed that if I used WindowScalePolicy::ScaleFactor(1.0) like nih_plug_egui, I saw the same issue exhibited in gain_gui. However, if I instead used WindowScalePolicy::SystemScaleFactor, the issue went away.

My minimal repro with WindowScalePolicy::ScaleFactor(1.0):

Screen.Recording.2022-02-27.at.00.31.56.mov

My minimal repro with WindowScalePolicy::SystemScaleFactor:

Screen.Recording.2022-02-27.at.00.30.57.mov

gain_gui with WindowScalePolicy::SystemScaleFactor:

Screen.Recording.2022-02-27.at.00.34.01.mov

So I think it makes sense to use WindowScalePolicy::SystemScaleFactor?

@apalm apalm reopened this Feb 27, 2022
@robbert-vdh
Copy link
Owner

Ah, good catch. Macs with their HiDPI screens. 😉

Hadn't really considered HiDPI yet since baseview doesn't support window resizing (and I already have two open PRs there), but I'll add this in the meantime. The host should be able to override this with IPlugViewContentScaleSupport::setContentScaleFactor() once that is in place. I added the change in b40c43a.

@theor
Copy link

theor commented Dec 12, 2022

for the sake of documenting it : bitwig has an option to scale plugin interfaces. when enabled, the same issue happens. disabling it fixes it.

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