kas-gui / kas

Another GUI toolkit
Apache License 2.0
892 stars 27 forks source link

Update deps and enable winit/x11 by default #436

Closed dhardy closed 5 months ago

dhardy commented 5 months ago

It turns out that examples were failing on X11 with a confusing message. https://github.com/rust-windowing/winit/pull/3414 fixes the message; this PR adds X11 to the default feature selection.

Update dependencies: env_logger, cfg_aliases, resvg and most significantly wgpu.

Safe handling of the window/surface lifetime. For now this uses Arc<winit::window::Window> to ensure the window outlives the surface. A true (efficient) solution would be closer to the self-referential struct problem (though without the aliasing and pinning sub-problems); essentially we could "just" cast the lifetime to 'static, however there's no good way to do this without making new_surface unsafe or depend on WGPU (having wgpu::SurfaceTarget in raw-window-handle would help).