-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[bug] Panic on Windows if a native window is created #3883
Comments
Thanks for the report, fix will be published soon. Really interesting use case btw :) |
Awesome, thanks Lucas! |
@lucasfernog I finally got around to updating, and this panic is fixed, but now there's a deadlock 😅 It's around the same place, right here when it receives a WindowEvent: Event::WindowEvent {
event, window_id, ..
} => {
let window_id = webview_id_map.get(&window_id); // <<< hangs here The event it's hanging on is I've put in a bunch of pub fn add_overlay(app_handle: &AppHandle) -> impl OverlayView {
let window = app_handle
.get_window("main")
.expect("failed to get main window");
let hwnd = window.hwnd().expect("failed to get HWND");
let overlay = app_handle
.create_tao_window(move || {
let window_builder = tao::window::WindowBuilder::new()
.with_always_on_top(false)
.with_decorations(false)
.with_resizable(false)
.with_visible(false)
.with_position(tao::dpi::LogicalPosition::<u32>::new(30, 30))
.with_owner_window(hwnd)
.with_inner_size(tao::dpi::LogicalSize::<u32>::new(200, 200));
("WGPU Target".to_string(), window_builder)
})
.expect("failed to create overlay window");
...
} I put this as a reply here since there's already some context, but I can create a separate issue if that makes more sense. |
@dceddia can you file a separate issue with an example I can use to reproduce it? tried with your tauri-window-hang-repro but couldn't reproduce it. Thanks! |
Ah, sorry - should've tried that first! I just went to update the example and realized that the overlay didn't have much to do with it. The problem was that I was making changes to the window in a tauri::command that wasn't |
Can you file an issue with your command? If it doesn't work in the main thread it's a bug. |
Describe the bug
When a native window is created with
AppHandle::create_tao_window
, then doing anything to the app causes it to panic. I think anything that causes a window event causes a panic.With tauri-1.0.0-rc.4 and tao 0.6.4 this was working fine, but after updating to tauri-1.0.0-rc.6 and tao 0.7.0 it's started panicing.
Reproduction
This repo has a minimal reproduction: https://github.com/dceddia/tauri-window-hang-repro
See the stack trace below. I think the relevant part is
#5
-tauri-runtime-wry-0.3.5\src\lib.rs:2447
, here. That section looks like it's handling window events, and it seems to make the assumption that an event will definitely come from a window with a webview.The
webview_id_map
, too, assumes that a call toget()
will find an associated window, and unwraps the Option, which causes the panic.Expected behavior
No panic :)
Platform and versions
Stack trace
Additional context
I'm not sure if I'm creating this window at the right time, or if I should be depending on
tao
directly here or if there's a better way, so let me know if anything could be better.The goal of having this native window is to make an empty overlay that I can draw in with
wgpu
.The text was updated successfully, but these errors were encountered: