Commit graph

59 commits

Author SHA1 Message Date
daxpedda
7fbc2118b6
Add support for MacOS ARM64 (#3862) 2024-08-13 23:01:17 +02:00
dependabot[bot]
42ba0a74e0
build(deps): bump EmbarkStudios/cargo-deny-action
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: daxpedda <daxpedda@gmail.com>
2024-08-04 15:14:12 +03:00
daxpedda
02a0a91a94
Remove raw-window-handle v0.4 and v0.5 support (#3831) 2024-08-04 00:18:39 +02:00
daxpedda
3398ebe467
Use Taplo for TOML formatting 2024-07-28 17:38:44 +02:00
dependabot[bot]
21c121f9b3
Bump GitHub Actions actions/cache and actions/configure-pages (#3836) 2024-07-28 17:06:44 +02:00
daxpedda
7892e86731
Move to TypeScript (#3830)
This moves our JS file to use TS instead, which allows us to use a proper linter to check the code.
All related files where moved out from the root in a dedicated folder to avoid polluting the Rust environment.
2024-07-27 18:26:52 +02:00
daxpedda
c9c260ca08
Exclude Redox OS from the MSRV policy (#3811)
Redox OS requires a Rust nightly toolchain to compile at the moment.
2024-07-23 13:46:35 +02:00
daxpedda
73c01fff96
Run doc tests on Web as well (#3799) 2024-07-20 21:20:18 +02:00
daxpedda
d5fd8682eb
Web: use the word "Web" correctly and consistently (#3785) 2024-07-10 16:17:39 +02:00
John Nunley
10dc0674bb ci: Use taiki-e/checkout-action
taiki-e/checkout-action has a few advantages over actions/checkout,
such as:

- It is written in Bash rather than Node.js
- It does not have frequent breaking changes, reducing churn

Signed-off-by: John Nunley <dev@notgull.net>
2024-06-23 12:28:58 -07:00
daxpedda
3e6092b8ed
Web: implement WaitUntilStrategy (#3739) 2024-06-20 23:07:42 +02:00
daxpedda
1552eb21f7
Bump MSRV to v1.73 (#3743) 2024-06-20 11:09:15 +02:00
Kirill Chibisov
7b0c7b6cb2
chore(rustfmt): use nightly (#2325)
Stable rustfmt lacks a lot of features resulting in worse formatted
code, thus use nightly formatter.
2024-04-26 17:11:44 +02:00
Bruce Mitchener
b79acd8a5a
ci: Update all jobs to actions/checkout@v4
Updates the checkout action to the latest version
2024-04-13 20:50:41 -07:00
Mads Marquart
fedb944d57 chore(docs): make changelogs visible on docsrs
Split changelog file to make it more comprehensible when reading and
also make it a part of documentation so it'll be more discoverable
by the users. This change also makes it possible for rust code inside
the changelogs to be tested with `cargo`.

Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
2024-03-15 17:19:19 +04:00
Kirill Chibisov
249d5d8bff bugfix(dpi): PhysicalUnit::to_logical computation
The conversion of PhysicalUnit was wrongly computed and the tests were
not running on the CI for the dpi crate, thus it was missed, even though
the test was correctly failing.

Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
2024-03-13 12:58:39 +04:00
AmeKnite
b2f9fad654 ci: add typos-cli
Given that typos are frequent and may appear in the public API spell
check code on CI.
2024-03-07 18:03:38 +04:00
Kirill Chibisov
a8c7109e89 Pin bumpalo to 3.14.0 on CI 2024-02-21 14:44:29 +04:00
Mads Marquart
2bc1943188
Pin ahash in CI (#3498)
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
2024-02-16 17:51:48 +01:00
daxpedda
ac247cd081
Fix missing target in docs.rs test (#3358) 2024-01-04 14:40:06 +01:00
daxpedda
ea1bfd254d
Add Wasm atomic target to CI (#3357) 2024-01-04 14:21:19 +01:00
daxpedda
178f5fda05
Test all docs.rs deployments (#3356) 2024-01-04 13:59:31 +01:00
Mads Marquart
42dbc4748e
Display all platform-specific documentation on docs.rs (#3076) 2024-01-04 12:54:35 +01:00
daxpedda
e37585e5bc
Bump MSRV to 1.70 (#3287) 2023-12-22 23:27:36 +01:00
daxpedda
9df7fc47a1
Install cargo-apk with the stable toolchain 2023-09-16 16:17:53 +04:00
John Nunley
c00c1e9eb7
Add an MSRV policy to the README (#3046) 2023-09-08 17:34:55 +02:00
Kirill Chibisov
7e11912d22
Lock the cargo-apk deps on CI 2023-08-27 19:05:45 +04:00
Mads Marquart
d9f04780cc
Improve CI caching, and give each job names
This improves CI performance by around 20% (down from 10 to 8 minutes).
2023-08-27 18:25:32 +04:00
Kirill Chibisov
6caff77abb
Bump MSRV to 1.65 2023-08-16 12:10:38 +04:00
Kirill Chibisov
cf77f82ae3
Update remaining actions to v3
This somehow was left unnoticed.
2023-06-03 17:00:55 +03:00
Markus Røyset
918430979f
Overhaul the Keyboard API
Overhaul the keyboard API in winit to mimic the W3C specification
to achieve better crossplatform parity. The `KeyboardInput` event
is now uses `KeyEvent` which consists of:

  - `physical_key` - a cross platform way to refer to scancodes;
  - `logical_key`  - keysym value, which shows your key respecting the
                     layout;
  - `text`         - the text produced by this keypress;
  - `location`     - the location of the key on the keyboard;
  - `repeat`       - whether the key was produced by the repeat.

And also a `platform_specific` field which encapsulates extra
information on desktop platforms, like key without modifiers
and text with all modifiers.

The `Modifiers` were also slightly reworked as in, the information
whether the left or right modifier is pressed is now also exposed
on platforms where it could be queried reliably. The support was
also added for the web and orbital platforms finishing the API
change.

This change made the `OptionAsAlt` API on macOS redundant thus it
was removed all together.

Co-authored-by: Artúr Kovács <kovacs.artur.barnabas@gmail.com>
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
Co-authored-by: daxpedda <daxpedda@gmail.com>
Fixes: #2631.
Fixes: #2055.
Fixes: #2032.
Fixes: #1904.
Fixes: #1810.
Fixes: #1700.
Fixes: #1443.
Fixes: #1343.
Fixes: #1208.
Fixes: #1151.
Fixes: #812.
Fixes: #600.
Fixes: #361.
Fixes: #343.
2023-05-28 21:02:59 +03:00
Kirill Chibisov
8a0edde5c8
Bump github actions to v3 2023-05-14 20:35:58 +03:00
Kirill Chibisov
2496098890
Update wayland-rs to 0.30.0
This update rewrites the winit's Wayland backend using new wayland-rs
0.30 API. This fixes long standing issue with the forward compatibility
of the wayland backend, meaning that future updates to the wayland
protocol won't break rust code anymore. like it was before when adding
new shm/enum variants into the protocol.

Fixes #2560.
Fixes #2164.
Fixes #2128.
Fixes #1760.
Fixes #725.
2023-04-19 00:56:29 +03:00
Emil Ernerfeldt
fbea75d31f
Add cargo-deny check to CI 2023-03-16 23:05:41 +03:00
Kirill Chibisov
b18295a1ce
Bump MSRV to 1.64 2023-03-08 19:34:10 +03:00
Jeremy Soller
66ca445caa
Redox OS support (#2588)
* Add Redox OS support

* Simplify control flow usage

* Apply more recommendations

* Update naming to indicate that Orbital is a platform

* Adjust import order
2023-01-05 06:58:08 -07:00
Marijn Suijten
ba4bf03675
ci: Specify to build winit package when invoking cargo-apk (#2561)
* 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.
2022-11-24 21:49:47 +01:00
Mads Marquart
ce6c6e8c95
Only build, but don't run tests in MSRV CI (#2558)
* Only build, but don't run tests in MSRV CI

Since the MSRV of development dependencies can easily be bumped without it affecting the MSRV of the published version of `winit`

* Run clippy on stable Rust instead of MSRV Rust

clippy inspects the `rust-version` field, and only suggests changes that conform to that.
2022-11-23 13:07:58 +01:00
Robert Bragg
05484c5888
Android: rework backend to use android-activity crate (#2444)
This updates the Android backend to use the android-activity crate instead
of ndk-glue. This solves a few issues:
1. The backend is agnostic of the application's choice of Activity base
   class
2. Winit is no longer responsible for handling any Java synchronization
   details, since these are encapsulated by the design of
   android_activity
3. The backend no longer depends on global / static getters for state
   such as the native_window() which puts it in a better position to
   support running multiple activities within a single Android process.
4. Redraw requests are flagged, not queued, in a way that avoids taking
   priority over user events (resolves #2299)

To make it possible for application crates to avoid explicitly
depending on the `android-activity` crate (and avoid version conflicts)
this re-exports the android-activity crate under:

  `winit::platform::android::activity::*`

This also adds `android-native-activity` and `android-game-activity`
features that set the corresponding android-activity features.

Addresses: PR https://github.com/rust-windowing/winit/pull/1892
Addresses: PR https://github.com/rust-windowing/winit/pull/2307
Addresses: PR https://github.com/rust-windowing/winit/pull/2343

Addresses: #2293
Resolves: #2299

Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com>

Co-authored-by: Markus Siglreithmaier <m.siglreith@gmail.com>
2022-11-10 17:55:19 +01:00
Marijn Suijten
05dd31b8ea
Revert "ci: manually point ANDROID_NDK_ROOT to latest supplied version"
This reverts commit 4895a29e92.

GitHub Actions' runner-images readded this environment variable on my
request [1] as it wasn't strictly related to the deprecated and removed
`ndk-bundle` NDK release.  Back out of the workaround to keep CI scripts
tidy.

[1]: https://github.com/actions/runner-images/issues/5879#issuecomment-1197811704
2022-09-06 16:48:28 +03:00
Mads Marquart
e0018d0710
Bump MSRV to 1.60 (#2453) 2022-09-02 10:59:05 +02:00
daxpedda
f9b41fd819
Update sctk-adwaita to use ab_glyph
The crossfont will still be available under the option.
2022-08-24 15:24:29 +03:00
Kirill Chibisov
fa83bace12
Remove redundant steps from CI
Tests are already building the entire crate, so no need for a
separate builds slowing down the CI.
2022-08-11 19:31:11 +04:00
Kirill Chibisov
bf537009d9
Explicitly specify minimum supported rust version
This should help with distributing apps using winit.

Fixes #1075.
2022-07-29 14:39:41 +03:00
Marijn Suijten
4895a29e92
ci: manually point ANDROID_NDK_ROOT to latest supplied version
It seems the symlink to `ndk-bundle` and this environment variable
pointing to it have been removed to prevent the sdkmanager from failing,
when finding the SDK setup to be in an "indeterminate" state.  It is now
up to the users themselves to install an NDK through that tool or point
the right variables to a preinstalled "latest" NDK.

https://github.com/actions/virtual-environments/issues/2689
https://github.com/actions/virtual-environments/pull/5926
2022-07-26 19:55:06 +03:00
Marijn Suijten
2b414cd825
ci: Disallow warnings in rustdoc and test private items (#2341)
Make sure `cargo doc` runs cleanly without any warnings in the CI - some
recently introduced but still allowing a PR to get merged.

In case someone wishes to add docs on private items, make sure those
adhere to the same standards.
2022-06-17 14:19:09 +02:00
Mads Marquart
c532d910c0
Build docs on docs.rs for iOS and Android as well (#2324) 2022-06-11 00:45:24 +02:00
Kirill Chibisov
10419ff441
Run clippy on CI
Fixes #1402.
2022-06-10 13:43:33 +03:00
Bartłomiej Maryńczak
829a140d9b
On Wayland, provide option for better CSD
While most compositors provide server side decorations, the GNOME
does not, and won't provide them. Also Wayland clients must render
client side decorations.

Winit was already drawing some decorations, however they were bad
looking and provided no text rendering, so the title was missing.
However this commit makes use of the SCTK external frame similar to
GTK's Adwaita theme supporting text rendering and looking similar to
other GTK applications.

Fixes #1967.
2022-05-20 03:09:23 +03:00
Mads Marquart
a033b25ecb
Make CI run on changes to non-code files as well (#2130)
The repository is configured such that specific checks are required to pass before merging; since CI doesn't run on PRs that don't change code, they can't be merged without administrator intervention.

Also, while this definition is currently correct, we might in the future change something so that changes to other files (like markdown files) really should be run through CI.

And example of that could be:
```rust
#[cfg(doctest)]
#[doc = include_str!("../README.md")]
extern "C" {}
```
2022-01-05 15:01:17 +01:00