Skip to content

Commit 44288f6

Browse files
authored
Make WindowAttributes private (rust-windowing#2134)
* Make `WindowAttributes` private, and move its documentation * Reorder WindowAttributes title and fullscreen to match method order
1 parent eec84ad commit 44288f6

File tree

14 files changed

+74
-98
lines changed

14 files changed

+74
-98
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre
88

99
# Unreleased
1010

11+
- **Breaking:** Removed the `WindowAttributes` struct, since all its functionality is accessible from `WindowBuilder`.
1112
- On macOS, Fix emitting `Event::LoopDestroyed` on CMD+Q.
1213
- On macOS, fixed an issue where having multiple windows would prevent run_return from ever returning.
1314
- On Wayland, fix bug where the cursor wouldn't hide in GNOME.

src/platform_impl/android/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ pub struct PlatformSpecificWindowBuilderAttributes;
641641
pub struct Window;
642642

643643
impl Window {
644-
pub fn new<T: 'static>(
644+
pub(crate) fn new<T: 'static>(
645645
_el: &EventLoopWindowTarget<T>,
646646
_window_attrs: window::WindowAttributes,
647647
_: PlatformSpecificWindowBuilderAttributes,

src/platform_impl/ios/view.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ unsafe fn get_window_class() -> &'static Class {
429429
}
430430

431431
// requires main thread
432-
pub unsafe fn create_view(
432+
pub(crate) unsafe fn create_view(
433433
_window_attributes: &WindowAttributes,
434434
platform_attributes: &PlatformSpecificWindowBuilderAttributes,
435435
frame: CGRect,
@@ -449,7 +449,7 @@ pub unsafe fn create_view(
449449
}
450450

451451
// requires main thread
452-
pub unsafe fn create_view_controller(
452+
pub(crate) unsafe fn create_view_controller(
453453
_window_attributes: &WindowAttributes,
454454
platform_attributes: &PlatformSpecificWindowBuilderAttributes,
455455
view: id,
@@ -505,7 +505,7 @@ pub unsafe fn create_view_controller(
505505
}
506506

507507
// requires main thread
508-
pub unsafe fn create_window(
508+
pub(crate) unsafe fn create_window(
509509
window_attributes: &WindowAttributes,
510510
_platform_attributes: &PlatformSpecificWindowBuilderAttributes,
511511
frame: CGRect,

src/platform_impl/ios/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl DerefMut for Window {
375375
}
376376

377377
impl Window {
378-
pub fn new<T>(
378+
pub(crate) fn new<T>(
379379
_event_loop: &EventLoopWindowTarget<T>,
380380
window_attributes: WindowAttributes,
381381
platform_attributes: PlatformSpecificWindowBuilderAttributes,

src/platform_impl/linux/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ impl VideoMode {
295295

296296
impl Window {
297297
#[inline]
298-
pub fn new<T>(
298+
pub(crate) fn new<T>(
299299
window_target: &EventLoopWindowTarget<T>,
300300
attribs: WindowAttributes,
301301
pl_attribs: PlatformSpecificWindowBuilderAttributes,

src/platform_impl/linux/wayland/window/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub struct Window {
7575
}
7676

7777
impl Window {
78-
pub fn new<T>(
78+
pub(crate) fn new<T>(
7979
event_loop_window_target: &EventLoopWindowTarget<T>,
8080
attributes: WindowAttributes,
8181
platform_attributes: PlatformAttributes,

src/platform_impl/linux/x11/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ impl Deref for Window {
638638
}
639639

640640
impl Window {
641-
pub fn new<T>(
641+
pub(crate) fn new<T>(
642642
event_loop: &EventLoopWindowTarget<T>,
643643
attribs: WindowAttributes,
644644
pl_attribs: PlatformSpecificWindowBuilderAttributes,

src/platform_impl/linux/x11/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ pub struct UnownedWindow {
114114
}
115115

116116
impl UnownedWindow {
117-
pub fn new<T>(
117+
pub(crate) fn new<T>(
118118
event_loop: &EventLoopWindowTarget<T>,
119119
window_attrs: WindowAttributes,
120120
pl_attribs: PlatformSpecificWindowBuilderAttributes,

src/platform_impl/macos/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ impl Deref for Window {
7070
}
7171

7272
impl Window {
73-
pub fn new<T: 'static>(
73+
pub(crate) fn new<T: 'static>(
7474
_window_target: &EventLoopWindowTarget<T>,
7575
attributes: WindowAttributes,
7676
pl_attribs: PlatformSpecificWindowBuilderAttributes,

src/platform_impl/macos/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ unsafe impl Send for UnownedWindow {}
371371
unsafe impl Sync for UnownedWindow {}
372372

373373
impl UnownedWindow {
374-
pub fn new(
374+
pub(crate) fn new(
375375
mut win_attribs: WindowAttributes,
376376
pl_attribs: PlatformSpecificWindowBuilderAttributes,
377377
) -> Result<(Arc<Self>, IdRef), RootOsError> {

0 commit comments

Comments
 (0)