* Use a bit less `unsafe` on iOS
I did test this in XCode 11.3's "Debug View Heirarchy", the NSStringRust problem is no longer applicable (likely because Rust got better at emitting correct debug info).
* Avoid using `id` on iOS
This commit fixes it, by not updating the `latest_error` when
any of the hooks handled the error, otherwise it'd interfere
with the winit's error checking.
When other application minimized the winit window the
minimize state was going out of sync. This commit fixes
it by polling the state in `set_minimized`.
* Add Redox OS support
* Simplify control flow usage
* Apply more recommendations
* Update naming to indicate that Orbital is a platform
* Adjust import order
* feat: add pointer events to web
* feat: remove PointerType for touch events
* Remove duplicate
* Changelog and features
* Remove PointerType
* feat: renamed events, added touch type guard
* Rename
* Flip the y axis
* Fix physical position and add force
* Update comment
* Update features
* Use normalized force
* Remove unnecessary todos
* Update comment
* Refactor add touch_handler
* Rephrase by Liamolucko
* Update CHANGELOG.md
* Fix duplicate mouse and touch events
* Removed workaround for scale factor
* Flip the y axis
* Fix
* Fmt
* Replace `match` with a single pattern with `if let`
* Update documentation
* Have one callback per event
* Remove a comment
* Fix
* Remove y-axis flip
* Update src/event.rs
Co-authored-by: Mads Marquart <mads@marquart.dk>
* Fix platform specific comment
* Fix extra argument to `touch_position` function
Co-authored-by: Dany Sluijk <me@dany.dev>
Co-authored-by: Johan Klokkhammer Helsing <johanhelsing@gmail.com>
Co-authored-by: oscrim <oscar@widefind.se>
Co-authored-by: Mads Marquart <mads@marquart.dk>
* fix clippy lints on Windows
* fix lints on other platforms
* a couple more
* again
* don't know what's goging on anymore
* fix examples
* comon
* how about now?
* this is getting annoying
* hmmm
* explicitly set a type
* 😢
* don't cast on x64 targets
* apply code review requests
* fix attributes on expressions
* fix ios
* On macOS, add `WindowBuilderExtMacOS::with_parent_window`
* Replace Parent with Option<Id<NSWindow, Shared>>
* Add addChildWindow method on NSWindow instead
* Update with_parent_window to be unsafe fn
* Add unified `with_parent_window`
* Remove `WindowBuilderExtUnix::with_parent`
* Remove `WindowBuilderExtWindows::with_parent_window`
* Clean up CI warnings
* Update CHANGELOG.md
It's `WindowBuilderExtX11` rather than `WindowBuilderExtUnix`
* Rename parent to owner
* Make with_parent_window unsafe and update its doc
* Add another way to get window on mac
* Add more documentations
* Add match arm and panic on invalid varients
* Add Xcb arm
* Update child_window example to make it safer and work in i686
* Remove duplicate entry in CHANGELOG.md
* Propogate error instead of expect
* Replace unreachable to panic
* Add platform note to X11
Co-authored-by: Wu Yu Wei <wusyong9104@gmail.com>
* Close windows synchronously on main thread
* Set style mask synchronously on main thread
* Set title synchronously on main thread
* Set visibility and focus synchronously on main thread
* Set window level synchronously on main thread
* Set position and size synchronously on main thread
* Set cursor hittest synchronously on main thread
* Add changelog entry
This fixes a crash on macOS when trying to get the monitor
refresh rate from the disabled monitor.
Co-authored-by: Jet Spark <lixiaopeng.jetspark@bytedance.com>
Co-authored-by: Mads Marquart <mads@marquart.dk>
* On Windows and macOS, add API to enable/disable window controls
* fix build
* missing import
* use `WindowButtons` flags
* rename to `[set_]enabled_buttons`
* add example, fix windows impl for minimize
* macOS: Fix button enabling close/minimize while disabling maximized
* Update src/platform_impl/windows/window.rs
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
* compose the flags on a sep line, use `bool::then`
Co-authored-by: Mads Marquart <mads@marquart.dk>
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
This adds `Window::set_window_level` to control the preferred
z level of the window.
Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com>
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
Co-authored-by: Mads Marquart <mads@marquart.dk>
* ci: Don't use `$CMD` for Android doc building
Since migrating `cargo-apk` to `clap` [it is now annoying] to pass
unknown arguments to an underlying `cargo` command (like `cargo doc`):
fortunately generating docs doesn't need to go through `cargo apk` to
set up cross-compiler/linker environment variables at all.
[it is now annoying]: https://github.com/rust-windowing/android-ndk-rs/pull/363
* ci: Simplify
* ci: Explicitly build just the `winit` package on Android
Since https://github.com/dvc94ch/cargo-subcommand/pull/23 `cargo-apk`
now strictly searches for workspaces first before committing to finding
the right package _within said workspace_, and bails when no package was
selected since we don't support selecting (building, packaging, running)
>1 target currently.
Perhaps it's a bit hash to enforce this on free-form `cargo apk --`
invocations, but it is what it is.