vizia icon indicating copy to clipboard operation
vizia copied to clipboard

Set input focus on alt-click

Open dathinaios opened this issue 2 years ago • 6 comments

I have submitted a PR for the input focus issue (https://github.com/RustAudio/baseview/pull/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.

dathinaios avatar Mar 19 '24 19:03 dathinaios

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.

geom3trik avatar Mar 29 '24 14:03 geom3trik

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?

dathinaios avatar Mar 31 '24 10:03 dathinaios

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.

geom3trik avatar Mar 31 '24 11:03 geom3trik

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.

dathinaios avatar Mar 31 '24 13:03 dathinaios

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.

geom3trik avatar Mar 31 '24 13:03 geom3trik

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.

dathinaios avatar Mar 31 '24 16:03 dathinaios