Skip to content
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

window_builder hook no longer exposes winit WindowBuilder #3853

Open
LunNova opened this issue Jan 21, 2024 · 0 comments
Open

window_builder hook no longer exposes winit WindowBuilder #3853

LunNova opened this issue Jan 21, 2024 · 0 comments
Labels
eframe Relates to epi and eframe egui-winit porblems related to winit feature New feature or request

Comments

@LunNova
Copy link

LunNova commented Jan 21, 2024

The window_builder hook was initially implemented in #3390 to allow directly configuring the winit windowbuilder.

#3172 removed this feature, and instead implemented specific support for only one particular winit NativeExt use for macos:

/// Hook into the building of a the native window.
///
/// You can configure any platform specific details required on top of the default configuration
/// done by `eframe`.
#[cfg(not(target_arch = "wasm32"))]
#[cfg(any(feature = "glow", feature = "wgpu"))]
pub type WindowBuilderHook = Box<dyn FnOnce(egui::ViewportBuilder) -> egui::ViewportBuilder>;

use winit::platform::macos::WindowBuilderExtMacOS as _;
window_builder = window_builder
.with_title_hidden(!_title_shown.unwrap_or(true))
.with_titlebar_buttons_hidden(!_titlebar_buttons_shown.unwrap_or(true))
.with_titlebar_transparent(!_titlebar_shown.unwrap_or(true))
.with_fullsize_content_view(_fullsize_content_view.unwrap_or(false));

The window_builder hook no longer matches its documentation, and now modifies the Viewportbuilder which was already available as the viewport field of NativeOptions.

window_builder should be reverted to take a winit WindowBuilder as its argument so native winit WindowBuilder extension can be used. It doesn't make sense for it to take ViewportBuilder as an argument.

@LunNova LunNova added the bug Something is broken label Jan 21, 2024
@emilk emilk added feature New feature or request eframe Relates to epi and eframe egui-winit porblems related to winit and removed bug Something is broken labels Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eframe Relates to epi and eframe egui-winit porblems related to winit feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants