app_window 0.3.5

Cross-platform window library
Documentation
[package]
name = "app_window"
version = "0.3.5"
edition = "2024"
authors = ["Drew Crawford <drew@sealedabstract.com>"]
description = "Cross-platform window library"
repository = "https://github.com/drewcrawford/app_window"
homepage = "https://sealedabstract.com/code/app_window"
license = "MPL-2.0"
keywords = ["window", "windowing", "input", "keyboard", "mouse"]
categories = ["gui", "os", "wasm", "asynchronous"]
exclude = [".*"]
rust-version = "1.95.0"

#[lib]

[features]
default = []
# Crate-local gates. Operational platform failures are stable events and are
# always compiled in -- a window that will not open is not something a consumer
# should have to opt into seeing. These control the optional extras.
logwise-diagnostic = []
logwise-forensic = []
logwise-performance = []
# Compatibility alias for consumers that still pass the pre-facade name.
logwise_internal = ["logwise-diagnostic"]
# A bounded registry of the windows this process created, exposed through
# exfiltrate's `snapshot` command. Off by default: it costs a lock and a record
# per window, and adds a field to `Window` and `Surface`.
#
# Main-thread liveness is *not* behind this. A frozen UI is an operational fact
# about the application, and this crate compiles those in unconditionally.
exfiltrate = ["dep:exfiltrate"]


[dependencies]
wasm_lite_std = "0.1.3"
atomic_float = "1.1.0"
raw-window-handle = "0.6.2"
logwise = "0.7.0"
thiserror = "2.0.17"
some_executor = "0.7.1"
continue = "0.1.3"
send_cells = "0.2.5"
exfiltrate = { version = "0.4.0", optional = true }

[dev-dependencies]
# needed for gpu example
wgpu = "28.0.0"
wasm_lite = "0.1.3"

# needed for submit_to_main_thread_benchmark
futures = "0.3"

# macos
[target.'cfg(target_os = "macos")'.dependencies]
swift-rs = "1.0.7"



[target.'cfg(target_os = "macos")'.build-dependencies]
swift-rs = { version = "1.0.7", features = ["build"] }

# wasm32
[target.'cfg(target_arch="wasm32")'.dependencies]
# Replaces web-sys/wasm-bindgen/wasm-bindgen-futures: the DOM surface this crate
# needs is `wasm_lite::dom`. No feature list, because the bindings are
# hand-written rather than generated per-interface.
wasm_lite = "0.1.3"
continue_stream = "0.1.3"

# `console_error_panic_hook` is replaced by `wasm_lite::set_panic_hook`.

[target.'cfg(target_arch="wasm32")'.dev-dependencies]
# Pin the wasm-bindgen family to the version implemented by wasm_lite's
# compatibility shim below. wgpu remains unmodified; its wasm-bindgen API calls
# are lowered to wasm_lite descriptors by the shim.
wasm-bindgen = "=0.2.108"


# windows

[target.'cfg(target_os="windows")'.dependencies]
windows = { version = "0.62.2", features=[
    "Win32_System_Threading",
    "Win32_UI_WindowsAndMessaging",
    "Win32_Graphics_Gdi",
    "Win32_System_LibraryLoader",
    "Win32_UI_HiDpi",
    "Win32_Foundation",
    "Win32_UI_Input_KeyboardAndMouse",
] }

# linux
[target.'cfg(target_os="linux")'.dependencies]
libc = "0.2.175"
wayland-client = "0.31.11"
wayland-backend = {version = "0.3.7", features=["client_system"]}
wayland-protocols = {version = "0.32.9", features = ["client"]}
wayland-cursor = "0.31.11"
memmap2 = "0.9.7"
io-uring = "0.7.9"
zune-png = "0.5.1"
# probably at some point this will be a global requirement,
# for now we only NEED it to advertise decorations on linux
accesskit = "0.24.0"
accesskit_unix = "0.20.0"
# input dependencies
tempfile = "3.21.0"
atspi = {version = "0.29.0", features=[]}


[[example]]
name = "gpu"

[[test]]
name = "executor_bug_test"
path = "tests/executor_bug_test.rs"
harness = false

[[test]]
name = "wasm_main_closure_execution_test"
path = "tests/wasm_main_closure_execution_test.rs"
harness = false

[[test]]
name = "submit_to_main_thread_benchmark"
path = "tests/submit_to_main_thread_benchmark.rs"
harness = false

[[test]]
name = "platform_coalesced_mouse_test"
path = "tests/platform_coalesced_mouse_test.rs"
harness = false
[[test]]
name = "platform_coalesced_keyboard_test"
path = "tests/platform_coalesced_keyboard_test.rs"
harness = false

[[test]]
name = "wgpu_test"
path = "tests/wgpu_test.rs"
harness = false

# harness = false, like every other test here: these drive the real platform
# main loop from `fn main`, which libtest's own main would otherwise replace.
[[test]]
name = "logwise_context_test"
path = "tests/logwise_context_test.rs"
harness = false

# Same reason: both providers only mean anything once the platform loop is
# running, so this drives the real one.
[[test]]
name = "exfiltrate_snapshot_test"
path = "tests/exfiltrate_snapshot_test.rs"
harness = false

[patch.crates-io]
# wgpu remains unmodified; this substitutes only its wasm-bindgen API surface.
# The compatibility crate's wasm_lite dependency resolves from crates.io.
wasm-bindgen = { git = "https://github.com/drewcrawford/wasm_lite", rev = "f47bf4178d666e83017abe056f07bb20d33c14cd" }