Move PlatformSpecificWindowBuilderAttributes (#3318)

This commit is contained in:
daxpedda 2024-01-17 23:37:28 +01:00 committed by GitHub
parent aec608f93c
commit d7c7ba1d6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 145 additions and 156 deletions

View file

@ -401,7 +401,6 @@ impl Window {
pub(crate) fn new(
event_loop: &EventLoopWindowTarget,
window_attributes: WindowAttributes,
platform_attributes: PlatformSpecificWindowBuilderAttributes,
) -> Result<Window, RootOsError> {
let mtm = event_loop.mtm;
@ -439,7 +438,7 @@ impl Window {
None => screen_bounds,
};
let view = WinitView::new(mtm, &window_attributes, &platform_attributes, frame);
let view = WinitView::new(mtm, &window_attributes, frame);
let gl_or_metal_backed = unsafe {
let layer_class = WinitView::layerClass();
@ -448,15 +447,8 @@ impl Window {
is_metal || is_gl
};
let view_controller =
WinitViewController::new(mtm, &window_attributes, &platform_attributes, &view);
let window = WinitUIWindow::new(
mtm,
&window_attributes,
&platform_attributes,
frame,
&view_controller,
);
let view_controller = WinitViewController::new(mtm, &window_attributes, &view);
let window = WinitUIWindow::new(mtm, &window_attributes, frame, &view_controller);
app_state::set_key_window(mtm, &window);
@ -685,7 +677,7 @@ impl From<&AnyObject> for WindowId {
}
}
#[derive(Clone, Default)]
#[derive(Clone, Debug, Default)]
pub struct PlatformSpecificWindowBuilderAttributes {
pub scale_factor: Option<f64>,
pub valid_orientations: ValidOrientations,