Comments (10)
Glutin locks us into an OpenGL rendering context, which could very well be unwanted by our users. We shouldn't use a rendering context beyond the web view, that should entirely be on the user.
For a hard counter example, Amethyst is using Tauri for their editor. Eventually, they will be rendering games in another window spawned in the same process, via our Multi-Window pattern.
from webview_rust.
Regarding Winit
, it might be better to go a little higher level and use something like Glutin
instead. It gives us an API to openGL and we could use it to generate custom native components on the webview window. Things like context menus and buttons. Since Glutin uses Winit in the backend, we get all of that functionality as well.
from webview_rust.
Thats fine, we can create a wrapper abstraction to allow the user to strip off glutin as a feature and use their own renderer. I just feel that it would give us some nice default patterns over using something as low level as winit.
from webview_rust.
from webview_rust.
What I would rather do is have that contained to the updater. Rendering engines aren't small, including any unless they're actually needed, or wanted by the user, is bloat, in both binary size and compile times.
from webview_rust.
Even if we want to use Glutin with a feature flag, the work for Winit so we can be sans-renderer will have to be done. It's a better default.
from webview_rust.
It turns out that WebviewGTK will not work with Winit. Solving the multi-window/GL concerns will take more research than this issue can afford at this point.
I'm handing off this work, so I'll outline what needs to be done:
-
In a new repo, we need create a set of Rust-safe bindings over ZSerge. The Rust bindgen tooling doesn't work with ZSerge, so this will have to be done by hand. After writing the
extern 'C'
functions, the Rust API should be minimal as to ensure the FFI-required unsafe is safely encapsulated. Where ZSerge passes a Window Pointer, we can passnull
, and let ZSerge spawn the windows, until we are ready to solve the multi-window/GL concerns. -
tauri-view
can have the submodule for ZSerge removed, and that can be added to the new repo.tauri-view
should wrap the new bindings with the existing abstraction intauri-utils
. Said abstraction needswindow_handle
removed for the time being. -
The rest of Tauri can then be updated to use
tauri_utils::WebView
as the concrete wrapper around any web view stack. The bundler should default to usingtauri-view
, but be configurable to accept a fully-resolved type (includes crate and module path) that implements theWebViewBinding
trait.
from webview_rust.
I'll take care of building the Rust bindings to Webview.
from webview_rust.
Not sure if this should stay open, but it seemed better placed here than in the core repo.
from webview_rust.
Closing as off topic.
from webview_rust.
Related Issues (12)
- CI HOT 3
- Seperate ffi module to a file or even become another `*-sys` HOT 4
- Generic function to convert closure to callback pointer in C
- Builder Pattern
- Documentation HOT 2
- Expose webview-official-sys crate HOT 1
- bug: window titles are not showing up in macOS HOT 1
- [Feature/Docs] Ability to Cross Compile From Linux to Windows & Mac HOT 3
- Fractional / HIDPI support (Windows)
- Get events from window
- Support for Apple Silicon/ARM on MacOS Big Sur HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webview_rust.