3
4
Fork
You've already forked egui-baseview
3

focusing issue in nih-plug / Windows 10 #20

Open
opened 2024年06月19日 17:17:22 +02:00 by nat3Github · 6 comments
nat3Github commented 2024年06月19日 17:17:22 +02:00 (Migrated from github.com)
Copy link

In Windows 10, nih-plug standalone version egui does not get keyboard input, because the parented windows is never focused.
always calling .focus() on the window fixes this but its not a nice solution.

In Windows 10, nih-plug standalone version egui does not get keyboard input, because the parented windows is never focused. always calling .focus() on the window fixes this but its not a nice solution.
murl-digital commented 2024年07月06日 01:54:20 +02:00 (Migrated from github.com)
Copy link

this was briefly talked about in the rust audio discord, basically keyboard focus with baseview is kind of a mess on windows, and ableton is partially to blame. i've tried fixing this but haven't had much luck

this was briefly talked about in the rust audio discord, basically keyboard focus with baseview is kind of a mess on windows, and ableton is partially to blame. i've tried fixing this but haven't had much luck
ardura commented 2024年08月27日 16:58:23 +02:00 (Migrated from github.com)
Copy link

@murl-digital your idea in past discord conversation + a post from an @Beepster fixed this for me. I have just maintained a fork of egui_baseview to keep this working in my plugins, but here is all I changed in egui_baseview to "make this work" although it doesn't feel like the right way :)

in src/window.rs at bottom of fn on_frame()

 if !full_output.platform_output.events.is_empty() || 
 full_output.platform_output.ime.is_some() {
 #[cfg(target_os = "windows")]
 window.focus();
 }
@murl-digital your idea in past discord conversation + a post from an @Beepster fixed this for me. I have just maintained a fork of egui_baseview to keep this working in my plugins, but here is all I changed in egui_baseview to "make this work" although it doesn't feel like the right way :) in src/window.rs at bottom of `fn on_frame()` ``` if !full_output.platform_output.events.is_empty() || full_output.platform_output.ime.is_some() { #[cfg(target_os = "windows")] window.focus(); } ```
BillyDM commented 2024年08月27日 22:34:46 +02:00 (Migrated from github.com)
Copy link

That is kind of hacky, but if you think this is a good temporary fix I could merge it upstream.

That is kind of hacky, but if you think this is a good temporary fix I could merge it upstream.
murl-digital commented 2024年08月28日 08:30:25 +02:00 (Migrated from github.com)
Copy link

i recall someone somewhere saying there were problems or it didn't work exactly how it was expected to, but i reckon it's good enough

i think it may be smart to put it behind a feature gate in case it has unintended consequences

i recall someone somewhere saying there were problems or it didn't work exactly how it was expected to, but i reckon it's good enough i think it may be smart to put it behind a feature gate in case it has unintended consequences
BillyDM commented 2024年08月29日 22:12:42 +02:00 (Migrated from github.com)
Copy link

Alright, I added a workaround in 6645c14

Alright, I added a workaround in 6645c14
peastman commented 2025年03月20日 00:24:50 +01:00 (Migrated from github.com)
Copy link

This same issue also exists on macOS, and the same fix works for it. When writing a plugin with NIH-Plug and loading it in Reaper, the plugin doesn't get any keyboard input. If I modify the above workaround to also call window.focus() on macOS, it works correctly. Could the workaround be updated to apply on both platforms?

This same issue also exists on macOS, and the same fix works for it. When writing a plugin with NIH-Plug and loading it in Reaper, the plugin doesn't get any keyboard input. If I modify the above workaround to also call `window.focus()` on macOS, it works correctly. Could the workaround be updated to apply on both platforms?
Sign in to join this conversation.
No Branch/Tag specified
main
egui_31
egui_32
egui_33
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RustAudio/egui-baseview#20
Reference in a new issue
RustAudio/egui-baseview
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?