Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Window attribute #4039

Open
wants to merge 59 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ce32a30
android: bump to `ndk 0.9.0` and `android-activity 0.6.0`
MarijnS95 Apr 27, 2024
c04c113
chore: ensure that `.cargo` config is not published
kchibisov Apr 27, 2024
61bd817
chore: fix some typos in comments (#3635)
growfrow Apr 27, 2024
cd6ec19
Don't set the background color when initializing with transparency (#…
madsmtm Apr 27, 2024
0812adc
Add UIGestureRecognizerDelegate and PanGestureRecogniser (#3597)
jpedrick Apr 27, 2024
4b3c065
Winit version 0.30.0
kchibisov Apr 26, 2024
4f2f0bc
Web: fix Clippy v1.78 FPs (#3678)
daxpedda May 3, 2024
ebd6454
Use `rustc-check-cfg` (#3682)
madsmtm May 6, 2024
c801b69
Retain ApplicationDelegate in NSWindowDelegate and NSView
madsmtm May 6, 2024
aebd5ed
macOS: Move util::EMPTY_RANGE to usage spot (#3685)
madsmtm May 6, 2024
a298b4d
Reduce usage of direct `msg_send!`
madsmtm May 6, 2024
dee7a40
Reexport older versions of raw-window-handle
linkmauve May 6, 2024
c4a8e93
fix doc typo in application.rs (#3676)
rbxb May 7, 2024
1afec3c
bugfix: Replace pointer dereference with read_unaligned
CinTheDev May 19, 2024
3206d10
chore: explicitly use cfg_aliases 0.2.1
kchibisov May 22, 2024
042667c
Resize when size changes on scale change on macOS
BillGoldenWater May 23, 2024
43f296b
event_loop: add is_x11 and is_wayland on EventLoop
dhardy May 26, 2024
fb4a674
Update `objc2` to `v0.2.2` (#3702)
madsmtm May 27, 2024
391a222
Implement ApplicationHandler for `&mut A` and `Box<A>` (#3709)
madsmtm May 29, 2024
bf4445b
Handle _selected_range sent to NSTextInputClient.setMarkedText(). (#3…
ShikiSuen May 31, 2024
ad92b4f
doc: clarify `Window::pre_present_notify` availability
filnet Jun 6, 2024
3a0928a
macOS: Improve event queuing (#3708)
madsmtm Jun 6, 2024
21e266f
macOS/iOS: Various refactorings in application state (#3720)
madsmtm Jun 6, 2024
437747b
Winit version 0.30.1
notgull Jun 1, 2024
b14d5c0
Web: queue `EventLoopProxy::send_event()` to microtask
daxpedda Jun 11, 2024
54e974c
Web: don't overwrite cursor with `CursorIcon::Default` (#3729)
daxpedda Jun 11, 2024
1745b01
Web: fix crash `InnerSizeWriter::request_inner_size()` (#3727)
daxpedda Jun 11, 2024
96388f4
chore: address 1.79 clippy lints
kchibisov Jun 15, 2024
b512ed1
macOS: fix opacity handling
kchibisov Jun 15, 2024
ecd1468
Revert: Web: don't wait for polling when sending events
kchibisov Jun 15, 2024
79aa95b
Winit version 0.30.2
kchibisov Jun 15, 2024
c73d8cf
x11: fix build on arm
kchibisov Jun 17, 2024
3d7d766
macOS: set the theme on the NSWindow, instead of application-wide
madsmtm Jun 20, 2024
a974640
Web: set control flow strategies on `EventLoop` (#3740)
daxpedda Jun 20, 2024
d8f4d8f
Web: implement `WaitUntilStrategy` (#3739)
daxpedda Jun 20, 2024
d2d4d20
Winit version 0.30.3
kchibisov Jun 20, 2024
6abfef1
Use `default-features`, not `default_features` (#3746)
waywardmonkeys Jun 22, 2024
7c81364
Update codeowner list
msiglreith Jun 22, 2024
faa641e
Add notgull as Windows maintainer
msiglreith Jun 22, 2024
655fdc8
ci: Use taiki-e/checkout-action
notgull Jun 23, 2024
feca480
Avoid `path` when importing modules (#3755)
madsmtm Jun 24, 2024
ec24c3e
wayland: ignore events for dead objects
kchibisov Jul 5, 2024
71dea46
Fix CI (#3775)
daxpedda Jul 5, 2024
6509f8a
Make `DeviceId/WindowId::dummy()` safe (#3784)
daxpedda Jul 14, 2024
ba18837
wayland: bump dependencies
kchibisov Jul 16, 2024
bf68ac0
Web: fix `WindowEvent::Resized` not using rAF (#3790)
daxpedda Jul 16, 2024
949cb0f
Web: fix `MouseMotion` coordinate space (#3770)
daxpedda Jun 28, 2024
04d8a28
Winit version 0.30.4
kchibisov Jul 16, 2024
1dec9b4
Web: implement `Error` for `CustomCursorError` (#3793)
daxpedda Jul 17, 2024
4b1aa51
macOS: fix building with `feature = "rwh_04"`
daxpedda Jul 22, 2024
9ca8c09
Web: don't block pen input (#3813)
daxpedda Jul 23, 2024
5735786
Fix CI for Rust v1.80 (#3822)
daxpedda Jul 25, 2024
5fce4a0
android: add `{Active,}EventLoopExtAndroid::android_app`
kchibisov Jul 26, 2024
77e8fe6
Windows: use `Box::leak()` instead of `Box::into_raw()`
daxpedda Aug 4, 2024
f3d1f92
macOS: skip releasing unavailable monitors
killercup Aug 5, 2024
fa3ec00
Add `ActiveEventLoop::system_theme()`
daxpedda Aug 5, 2024
8c07319
chore: drop libera link
kchibisov Aug 6, 2024
114512b
Winit version 0.30.5
kchibisov Aug 7, 2024
cf18712
feat: add window attribute to the window
Mehrbod2002 Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Android
/src/platform/android.rs @msiglreith @MarijnS95
/src/platform_impl/android @msiglreith @MarijnS95
/src/platform/android.rs @MarijnS95
/src/platform_impl/android @MarijnS95

# iOS
/src/platform/ios.rs @madsmtm
Expand All @@ -26,8 +26,8 @@
/src/platform_impl/web @daxpedda

# Windows
/src/platform/windows.rs @msiglreith
/src/platform_impl/windows @msiglreith
/src/platform/windows.rs @notgull
/src/platform_impl/windows @notgull

# Orbital (Redox OS)
/src/platform/orbital.rs @jackpot51
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/checkout-action@v1
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
Expand All @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/install-action@v2
with:
tool: typos-cli
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
CMD: ${{ matrix.platform.cmd }}

steps:
- uses: actions/checkout@v4
- uses: taiki-e/checkout-action@v1

- name: Restore cache of cargo folder
# We use `restore` and later `save`, so that we can create the key after
Expand Down Expand Up @@ -220,9 +220,24 @@ jobs:
- { name: 'Windows', target: x86_64-pc-windows-gnu }

steps:
- uses: actions/checkout@v4
- uses: taiki-e/checkout-action@v1
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
log-level: error
arguments: --all-features --target ${{ matrix.platform.target }}

swc:
name: Minimize JavaScript
runs-on: ubuntu-latest

steps:
- uses: taiki-e/checkout-action@v1
- name: Install SWC
run: sudo npm i -g @swc/cli
- name: Run SWC
run: |
swc src/platform_impl/web/web_sys/worker.js -o src/platform_impl/web/web_sys/worker.min.js
- name: Check for diff
run: |
[[ -z $(git status -s) ]]
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ target/
rls/
.vscode/
*~
*.wasm
*.ts
*.js
#*#
.DS_Store
12 changes: 12 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"minify": true,
"jsc": {
"target": "es2022",
"minify": {
"compress": {
"unused": true
},
"mangle": true
}
}
}
70 changes: 51 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "winit"
version = "0.29.15"
version = "0.30.5"
authors = [
"The winit contributors",
"Pierre Krieger <[email protected]>",
Expand All @@ -14,6 +14,7 @@ rust-version.workspace = true
repository.workspace = true
license.workspace = true
edition.workspace = true
exclude = ["/.cargo"]

[package.metadata.docs.rs]
features = [
Expand Down Expand Up @@ -70,7 +71,7 @@ rwh_05 = ["dep:rwh_05", "ndk/rwh_05"]
rwh_06 = ["dep:rwh_06", "ndk/rwh_06"]

[build-dependencies]
cfg_aliases = "0.2.0"
cfg_aliases = "0.2.1"

[dependencies]
bitflags = "2"
Expand All @@ -85,11 +86,11 @@ rwh_06 = { package = "raw-window-handle", version = "0.6", features = [
], optional = true }
serde = { workspace = true, optional = true }
smol_str = "0.2.0"
tracing = { version = "0.1.40", default_features = false }
tracing = { version = "0.1.40", default-features = false }

[dev-dependencies]
image = { version = "0.25.0", default-features = false, features = ["png"] }
tracing = { version = "0.1.40", default_features = false, features = ["log"] }
tracing = { version = "0.1.40", default-features = false, features = ["log"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
winit = { path = ".", features = ["rwh_05"] }

Expand All @@ -102,36 +103,41 @@ softbuffer = { version = "0.4.0", default-features = false, features = [
] }

[target.'cfg(target_os = "android")'.dependencies]
android-activity = "0.5.0"
ndk = { version = "0.8.0", default-features = false }
ndk-sys = "0.5.0"
android-activity = "0.6.0"
ndk = { version = "0.9.0", default-features = false }

[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
core-foundation = "0.9.3"
objc2 = "0.5.1"
objc2 = "0.5.2"

[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = "0.23.1"
block2 = "0.5.1"

[target.'cfg(target_os = "macos")'.dependencies.objc2-foundation]
version = "0.2.0"
version = "0.2.2"
features = [
"block2",
"dispatch",
"NSArray",
"NSAttributedString",
"NSData",
"NSDictionary",
"NSDistributedNotificationCenter",
"NSEnumerator",
"NSKeyValueObserving",
"NSNotification",
"NSObjCRuntime",
"NSString",
"NSPathUtilities",
"NSProcessInfo",
"NSRunLoop",
"NSString",
"NSThread",
"NSValue",
]

[target.'cfg(target_os = "macos")'.dependencies.objc2-app-kit]
version = "0.2.0"
version = "0.2.2"
features = [
"NSAppearance",
"NSApplication",
Expand Down Expand Up @@ -162,7 +168,7 @@ features = [
]

[target.'cfg(target_os = "ios")'.dependencies.objc2-foundation]
version = "0.2.0"
version = "0.2.2"
features = [
"dispatch",
"NSArray",
Expand All @@ -175,6 +181,29 @@ features = [
"NSSet",
]

[target.'cfg(target_os = "ios")'.dependencies.objc2-ui-kit]
version = "0.2.2"
features = [
"UIApplication",
"UIDevice",
"UIEvent",
"UIGeometry",
"UIGestureRecognizer",
"UIOrientation",
"UIPanGestureRecognizer",
"UIPinchGestureRecognizer",
"UIResponder",
"UIRotationGestureRecognizer",
"UIScreen",
"UIScreenMode",
"UITapGestureRecognizer",
"UITouch",
"UITraitCollection",
"UIView",
"UIViewController",
"UIWindow",
]

[target.'cfg(target_os = "windows")'.dependencies]
unicode-segmentation = "1.7.1"

Expand Down Expand Up @@ -210,7 +239,7 @@ features = [
[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies]
ahash = { version = "0.8.7", features = ["no-rng"], optional = true }
bytemuck = { version = "1.13.1", default-features = false, optional = true }
calloop = "0.12.3"
calloop = "0.13.0"
libc = "0.2.64"
memmap2 = { version = "0.9.0", optional = true }
percent-encoding = { version = "2.0", optional = true }
Expand All @@ -220,18 +249,18 @@ rustix = { version = "0.38.4", default-features = false, features = [
"thread",
"process",
] }
sctk = { package = "smithay-client-toolkit", version = "0.18.0", default-features = false, features = [
sctk = { package = "smithay-client-toolkit", version = "0.19.2", default-features = false, features = [
"calloop",
], optional = true }
sctk-adwaita = { version = "0.9.0", default_features = false, optional = true }
wayland-backend = { version = "0.3.0", default_features = false, features = [
sctk-adwaita = { version = "0.10.1", default-features = false, optional = true }
wayland-backend = { version = "0.3.5", default-features = false, features = [
"client_system",
], optional = true }
wayland-client = { version = "0.31.1", optional = true }
wayland-protocols = { version = "0.31.0", features = [
wayland-client = { version = "0.31.4", optional = true }
wayland-protocols = { version = "0.32.2", features = [
"staging",
], optional = true }
wayland-protocols-plasma = { version = "0.2.0", features = [
wayland-protocols-plasma = { version = "0.3.2", features = [
"client",
], optional = true }
x11-dl = { version = "2.19.1", optional = true }
Expand All @@ -256,6 +285,7 @@ features = [
'AbortController',
'AbortSignal',
'Blob',
'BlobPropertyBag',
'console',
'CssStyleDeclaration',
'Document',
Expand All @@ -279,6 +309,7 @@ features = [
'MediaQueryList',
'MessageChannel',
'MessagePort',
'Navigator',
'Node',
'PageTransitionEvent',
'PointerEvent',
Expand All @@ -291,6 +322,7 @@ features = [
'VisibilityState',
'Window',
'WheelEvent',
'Worker',
'Url',
]

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```toml
[dependencies]
winit = "0.29.15"
winit = "0.30.5"
```

## [Documentation](https://docs.rs/winit)
Expand All @@ -19,7 +19,7 @@ For features _outside_ the scope of winit, see [Are we GUI Yet?](https://arewegu

## Contact Us

Join us in our [![Matrix](https://img.shields.io/badge/Matrix-%23rust--windowing%3Amatrix.org-blueviolet.svg)](https://matrix.to/#/#rust-windowing:matrix.org) room. If you don't get an answer there, try [![Libera.Chat](https://img.shields.io/badge/libera.chat-%23winit-red.svg)](https://web.libera.chat/#winit).
Join us in our [![Matrix](https://img.shields.io/badge/Matrix-%23rust--windowing%3Amatrix.org-blueviolet.svg)](https://matrix.to/#/#rust-windowing:matrix.org) room.

The maintainers have a meeting every friday at UTC 15. The meeting notes can be found [here](https://hackmd.io/@winit-meetings).

Expand Down
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use cfg_aliases::cfg_aliases;

fn main() {
// The script doesn't depend on our code
// The script doesn't depend on our code.
println!("cargo:rerun-if-changed=build.rs");

// Setup cfg aliases
// Setup cfg aliases.
cfg_aliases! {
// Systems.
android_platform: { target_os = "android" },
Expand All @@ -21,4 +21,7 @@ fn main() {
wayland_platform: { all(feature = "wayland", free_unix, not(redox)) },
orbital_platform: { redox },
}

// Winit defined cfgs.
println!("cargo:rustc-check-cfg=cfg(unreleased_changelogs)");
}
1 change: 0 additions & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ deny = []
skip = [
{ name = "raw-window-handle" }, # we intentionally have multiple versions of this
{ name = "bitflags" }, # the ecosystem is in the process of migrating.
{ name = "libloading" }, # x11rb uses a different version until the next update
]
skip-tree = []

Expand Down
Loading