Accepts first mouse (#2457)

* MacOS: set value for `accepts_first_mouse`

* Update CHANGELOG and FEATURES

* Field doesn't need to be public

* Convert `bool` to `BOOL`

* Fix formatting

* Move flag from window state to view instance

* Feedback from PR

* Fix changelog location
This commit is contained in:
Mads Marquart 2022-09-13 21:11:18 +02:00
parent 58f2455aa9
commit 48b843e42d
5 changed files with 30 additions and 6 deletions

View file

@ -79,6 +79,7 @@ pub struct PlatformSpecificWindowBuilderAttributes {
pub fullsize_content_view: bool,
pub disallow_hidpi: bool,
pub has_shadow: bool,
pub accepts_first_mouse: bool,
}
impl Default for PlatformSpecificWindowBuilderAttributes {
@ -93,6 +94,7 @@ impl Default for PlatformSpecificWindowBuilderAttributes {
fullsize_content_view: false,
disallow_hidpi: false,
has_shadow: true,
accepts_first_mouse: true,
}
}
}
@ -354,7 +356,7 @@ impl WinitWindow {
})
.ok_or_else(|| os_error!(OsError::CreationError("Couldn't create `NSWindow`")))?;
let view = WinitView::new(&this);
let view = WinitView::new(&this, pl_attrs.accepts_first_mouse);
// The default value of `setWantsBestResolutionOpenGLSurface:` was `false` until
// macos 10.14 and `true` after 10.15, we should set it to `YES` or `NO` to avoid