Skip to content

Commit

Permalink
Renamed all references to winit WindowBuilder to WindowAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriBaal committed Jun 10, 2024
1 parent 2c6e79a commit 2235204
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ pub fn create_window(
let window_attributes =
create_winit_window_attributes(egui_ctx, event_loop, viewport_builder.clone());
let window = {
crate::profile_scope!("WindowBuilder::build");
crate::profile_scope!("WindowAttributes::build");
event_loop.create_window(window_attributes)?
};
apply_viewport_builder_to_window(egui_ctx, &window, viewport_builder);
Expand Down Expand Up @@ -1709,7 +1709,7 @@ pub fn create_winit_window_attributes(

#[cfg(target_os = "macos")]
{
use winit::platform::macos::WindowBuilderExtMacOS as _;
use winit::platform::macos::WindowAttributesExtMacOS as _;
window_attributes = window_attributes
.with_title_hidden(!_title_shown.unwrap_or(true))
.with_titlebar_buttons_hidden(!_titlebar_buttons_shown.unwrap_or(true))
Expand Down
6 changes: 3 additions & 3 deletions crates/egui-winit/src/window_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ impl WindowSettings {
) -> ViewportBuilder {
crate::profile_function!();

// `WindowBuilder::with_position` expects inner position in Macos, and outer position elsewhere
// See [`winit::window::WindowBuilder::with_position`] for details.
// `WindowAttributes::with_position` expects inner position in Macos, and outer position elsewhere
// See [`winit::window::WindowAttributes::with_position`] for details.
let pos_px = if cfg!(target_os = "macos") {
self.inner_position_pixels
} else {
Expand Down Expand Up @@ -89,7 +89,7 @@ impl WindowSettings {
pub fn initialize_window(&self, window: &winit::window::Window) {
if cfg!(target_os = "macos") {
// Mac sometimes has problems restoring the window to secondary monitors
// using only `WindowBuilder::with_position`, so we need this extra step:
// using only `WindowAttributes::with_position`, so we need this extra step:
if let Some(pos) = self.outer_position_pixels {
window.set_outer_position(winit::dpi::PhysicalPosition { x: pos.x, y: pos.y });
}
Expand Down
2 changes: 1 addition & 1 deletion crates/egui/src/viewport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ impl ViewportBuilder {
/// See [winit's documentation][drag_and_drop] for information on why you
/// might want to disable this on windows.
///
/// [drag_and_drop]: https://docs.rs/winit/latest/x86_64-pc-windows-msvc/winit/platform/windows/trait.WindowBuilderExtWindows.html#tymethod.with_drag_and_drop
/// [drag_and_drop]: https://docs.rs/winit/latest/x86_64-pc-windows-msvc/winit/platform/windows/trait.WindowAttributesExtWindows.html#tymethod.with_drag_and_drop
#[inline]
pub fn with_drag_and_drop(mut self, value: bool) -> Self {
self.drag_and_drop = Some(value);
Expand Down

0 comments on commit 2235204

Please sign in to comment.