robbert-vdh / nih-plug

Rust VST3 and CLAP plugin framework and plugins - because everything is better when you do it yourself
ISC License
1.81k stars 152 forks source link

Vizia textbox unusable after window unfocus #130

Closed fitzthum closed 8 months ago

fitzthum commented 8 months ago

I am trying to add a textbox to my plugin editor (with Vizia). The behavior of the textbox has been strange. At first, the textbox generated no events whatsoever. After adding some seemingly unrelated changes, I get different behavior. The textbox works the first time that I open the editor, but as soon as I unfocus the window (i.e. open another program), the textbox stops generating events again (even if I close and reopen the editor).

I have mainly been testing with Carla, but I see the same behavior with Reaper. Also, when I use carla-single the textboxes do not work at all. Maybe this issue belongs in the Vizia repo, but I don't have any issues with any of the Vizia demos. Also, it looks like this repo pulls an old (patched) version of Vizia that does not have some recent changes regarding Textboxes. Not sure if this is significant.

Anyway, has anyone seen this kind of behavior before? Any ideas how I might debug? I have tried tons of different configurations for the textbox itself but this seems like it might be a deeper issue.

robbert-vdh commented 8 months ago

Baseview (and in turn, vizia_baseview) doesn't have any way to control input focus. You get what you get, and what you get depends on the OS and host you're using. You'll need to check the current status on the baseview and/or vizia projects for this.

fitzthum commented 8 months ago

I built the vizia textbox example with the baseview backend and everything works fine.

Maybe I shouldn't have used the term focus. Actually, focusing on the input is the one thing that does still seem to work. I can focus the textbox, but I can't enter any text. This problem shows up when I click off the window, although I've added a few debugging things since the first post and now the textboxes never accept any input. In fact even after I undid my debugging changes and rebuilt they still don't work at all.

dathinaios commented 8 months ago

@fitzthum I have been stuck with this issue too but as Robbert said it is not an nih-plug issue. You can follow the issue in baseview to see when it is resolved: https://github.com/RustAudio/baseview/issues/152

I am trying to make the necessary changes myself at the moment though it is not as simple as it looks at first.

fitzthum commented 8 months ago

@dathinaios ah thanks for the pointer. I will check out the issue.