-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
Panic under macOS with latest winit version #1477
Comments
we had a lot of problems in the past with using a subview, probably regarding key events to the webview (I don't remember which tbh, maybe @pewsheen or @FabianLars or @lucasfernog has better idea) and we were kinda forced to replace the content view. I am not a macOS developer, but maybe @madsmtm have an idea? could we possibly inherit the few references:
There is probably more history there, we really need to document this. |
Yeah, replacing the content view is unsupported by Winit (and was UB in I'm somewhat reluctant of exposing Besides, fundamentally, I think replacing the content view is basically always the wrong choice. Like, sure, Tauri might want the entire window to be filled by Wry, but I can easily imagine applications that would rather embed Wry into a subview somewhere. I'd rather work with you to get the "add view as subview" use-case working in Winit. Maybe we need to call
Resizing can indeed be perilous, but not impossible; for the GPU ecosystem, I've written |
For what it's worth, I've been using a subview for the webview (i.e. Webview::new_as_child), and it's been working well for my use-case, with the following two exceptions:
|
For the resizing being non-performant, part of that is also "just" a Winit issue: rust-windowing/winit#2640.
Hmm, might need us to call In what manner doesn't it work? A crash? Or is the request just ignored? Just to verify, how are you changing the cursor? With Winit's |
No, I'm just setting |
Using the latest winit and wry, we get a panic from winit on macOS when backgrounding (command-tabbing) the application:
This is because winit checks that the contentView is of type WinitView in WinitWindowDelegate::view:
But wry replaces the content view with
WryWebViewParent
(unless we're explicitly using a child view).(And command-tabbing invokes WinitWindowDelegate::window_did_resign_key, which invokes WinitWindowDelegate::view from above.)
Minimal(ish) reproducible example: https://gist.github.com/jnb/53568af99de5d3c40bf7dc2646aee93a
Editorializing: replacing the content view seems to be breaking a pretty fundamental assumption of winit? So it's not clear to me how wry can work on macOS without requiring the use of child view (which would be unfortunate, because resizing child views causes a lot of jank).
The text was updated successfully, but these errors were encountered: