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

Set input focus on alt-click #463

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

dathinaios
Copy link

@dathinaios dathinaios commented Mar 19, 2024

I have submitted a PR for the input focus issue (RustAudio/baseview#170). Assuming it is accepted and merged in baseview these are the changes required on vizia_baseview.

I have opted for the least intrusive call on alt-click but I wonder if there are other occasions that would need it. Let me know what you think.

I have tested this as mentioned in the baseview PR.

@geom3trik
Copy link
Collaborator

I've opened #466 which allows window events to be handled by baseview. I think this could be used in conjunction with what you have here to focus the window when requested by say a textbox being focused etc.

@dathinaios
Copy link
Author

I've opened #466 which allows window events to be handled by baseview. I think this could be used in conjunction with what you have here to focus the window when requested by say a textbox being focused etc.

Are you thinking of adding something like this:

 ViziaWindow { application, on_idle, should_close: false, should_focus: false }

and then handling the event similarly to what you did for close?

@geom3trik
Copy link
Collaborator

I've opened #466 which allows window events to be handled by baseview. I think this could be used in conjunction with what you have here to focus the window when requested by say a textbox being focused etc.

Are you thinking of adding something like this:

 ViziaWindow { application, on_idle, should_close: false, should_focus: false }

and then handling the event similarly to what you did for close?

No, that's only there for close because closing the window needs to happen after event handling. What I'm proposing is adding a focus event to WindowEvent, which can be emitted by a textbox and then handled by the callback I've added to the process events function so that the relevant function can be called on the baseview window.

@dathinaios
Copy link
Author

dathinaios commented Mar 31, 2024

No, that's only there for close because closing the window needs to happen after event handling. What I'm proposing is adding a focus event to WindowEvent, which can be emitted by a textbox and then handled by the callback I've added to the process events function so that the relevant function can be called on the baseview window.

Oh, I see. So I will just have to add the focus code inside handle_event in its own event handler right? That should be fine though we still need to pass in the window.

@geom3trik
Copy link
Collaborator

Oh, I see. So I will just have to add the focus code inside handle_event in its own event handler right? That should be fine though we still need to pass in the window.

The focus code would go inside the closure I've added to process_events in the linked PR. You can pass the window into this and call focus on it.

@dathinaios
Copy link
Author

The focus code would go inside the closure I've added to process_events in the linked PR. You can pass the window into this and call focus on it.

Ok, I will have a look thank you. Unfortunately at the moment vizia and nih_plug are out of sync. I still need to use Robbert's Vizia fork locally to test the input focus fix. Once the changes are merged in nih_plug_vizia I can implement and test.

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

Successfully merging this pull request may close these issues.

None yet

2 participants