chore(deps): update core-graphics to 0.25. Switch from dispatch to dispatch2. (#1116)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
This commit is contained in:
renovate[bot]
2026-01-20 13:49:08 +01:00
committed by GitHub
parent b55f576670
commit 648161769c
4 changed files with 160 additions and 146 deletions

224
Cargo.lock generated
View File

@@ -186,20 +186,11 @@ checksum = "7c12d1856e42f0d817a835fe55853957c85c8c8a470114029143d3f12671446e"
[[package]] [[package]]
name = "block2" name = "block2"
version = "0.5.1" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5"
dependencies = [ dependencies = [
"objc2 0.5.2", "objc2",
]
[[package]]
name = "block2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d59b4c170e16f0405a2e95aff44432a0d41aa97675f3d52623effe95792a037"
dependencies = [
"objc2 0.6.0",
] ]
[[package]] [[package]]
@@ -310,12 +301,6 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cfg_aliases"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724"
[[package]] [[package]]
name = "color_quant" name = "color_quant"
version = "1.1.0" version = "1.1.0"
@@ -356,9 +341,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
[[package]] [[package]]
name = "core-graphics" name = "core-graphics"
version = "0.24.0" version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa95a34622365fa5bbf40b20b75dba8dfa8c94c734aea8ac9a5ca38af14316f1" checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"core-foundation", "core-foundation",
@@ -440,10 +425,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35"
[[package]] [[package]]
name = "dispatch" name = "dispatch2"
version = "0.2.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" checksum = "89a09f22a6c6069a18470eb92d2298acf25463f14256d24778e1230d789a2aec"
dependencies = [
"bitflags 2.8.0",
"block2",
"libc",
"objc2",
]
[[package]] [[package]]
name = "displaydoc" name = "displaydoc"
@@ -505,25 +496,26 @@ dependencies = [
[[package]] [[package]]
name = "drm" name = "drm"
version = "0.12.0" version = "0.14.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98888c4bbd601524c11a7ed63f814b8825f420514f78e96f752c437ae9cbb5d1" checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"bytemuck", "bytemuck",
"drm-ffi", "drm-ffi",
"drm-fourcc", "drm-fourcc",
"rustix", "libc",
"rustix 0.38.44",
] ]
[[package]] [[package]]
name = "drm-ffi" name = "drm-ffi"
version = "0.8.0" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97c98727e48b7ccb4f4aea8cfe881e5b07f702d17b7875991881b41af7278d53" checksum = "d8e41459d99a9b529845f6d2c909eb9adf3b6d2f82635ae40be8de0601726e8b"
dependencies = [ dependencies = [
"drm-sys", "drm-sys",
"rustix", "rustix 0.38.44",
] ]
[[package]] [[package]]
@@ -534,9 +526,9 @@ checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4"
[[package]] [[package]]
name = "drm-sys" name = "drm-sys"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd39dde40b6e196c2e8763f23d119ddb1a8714534bf7d77fa97a65b0feda3986" checksum = "bafb66c8dbc944d69e15cfcc661df7e703beffbaec8bd63151368b06c5f9858c"
dependencies = [ dependencies = [
"libc", "libc",
"linux-raw-sys 0.6.5", "linux-raw-sys 0.6.5",
@@ -1297,9 +1289,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.169" version = "0.2.180"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
[[package]] [[package]]
name = "libfuzzer-sys" name = "libfuzzer-sys"
@@ -1333,6 +1325,12 @@ version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7" checksum = "2a385b1be4e5c3e362ad2ffa73c392e53f031eaa5b7d648e64cd87f27f6063d7"
[[package]]
name = "linux-raw-sys"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
[[package]] [[package]]
name = "litemap" name = "litemap"
version = "0.7.3" version = "0.7.3"
@@ -1537,27 +1535,11 @@ dependencies = [
"syn 2.0.96", "syn 2.0.96",
] ]
[[package]]
name = "objc-sys"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310"
[[package]] [[package]]
name = "objc2" name = "objc2"
version = "0.5.2" version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" checksum = "b7c2599ce0ec54857b29ce62166b0ed9b4f6f1a70ccc9a71165b6154caca8c05"
dependencies = [
"objc-sys",
"objc2-encode",
]
[[package]]
name = "objc2"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3531f65190d9cff863b77a99857e74c314dd16bf56c538c4b57c7cbc3f3a6e59"
dependencies = [ dependencies = [
"objc2-encode", "objc2-encode",
] ]
@@ -1569,19 +1551,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5906f93257178e2f7ae069efb89fbd6ee94f0592740b5f8a1512ca498814d0fb" checksum = "5906f93257178e2f7ae069efb89fbd6ee94f0592740b5f8a1512ca498814d0fb"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"objc2 0.6.0", "objc2",
"objc2-core-foundation", "objc2-core-foundation",
"objc2-foundation 0.3.0", "objc2-foundation",
] ]
[[package]] [[package]]
name = "objc2-core-foundation" name = "objc2-core-foundation"
version = "0.3.0" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "daeaf60f25471d26948a1c2f840e3f7d86f4109e3af4e8e4b5cd70c39690d925" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"objc2 0.6.0", "dispatch2",
"objc2",
]
[[package]]
name = "objc2-core-graphics"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807"
dependencies = [
"bitflags 2.8.0",
"dispatch2",
"objc2",
"objc2-core-foundation",
"objc2-io-surface",
] ]
[[package]] [[package]]
@@ -1592,50 +1588,36 @@ checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
[[package]] [[package]]
name = "objc2-foundation" name = "objc2-foundation"
version = "0.2.2" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"block2 0.5.1", "objc2",
"libc",
"objc2 0.5.2",
]
[[package]]
name = "objc2-foundation"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a21c6c9014b82c39515db5b396f91645182611c97d24637cf56ac01e5f8d998"
dependencies = [
"bitflags 2.8.0",
"objc2 0.6.0",
"objc2-core-foundation", "objc2-core-foundation",
] ]
[[package]] [[package]]
name = "objc2-metal" name = "objc2-io-surface"
version = "0.2.2" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" checksum = "180788110936d59bab6bd83b6060ffdfffb3b922ba1396b312ae795e1de9d81d"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"block2 0.5.1", "objc2",
"objc2 0.5.2", "objc2-core-foundation",
"objc2-foundation 0.2.2",
] ]
[[package]] [[package]]
name = "objc2-quartz-core" name = "objc2-quartz-core"
version = "0.2.2" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" checksum = "96c1358452b371bf9f104e21ec536d37a650eb10f7ee379fff67d2e08d537f1f"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"block2 0.5.1", "objc2",
"objc2 0.5.2", "objc2-core-foundation",
"objc2-foundation 0.2.2", "objc2-foundation",
"objc2-metal",
] ]
[[package]] [[package]]
@@ -2036,6 +2018,19 @@ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.59.0",
] ]
[[package]]
name = "rustix"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
dependencies = [
"bitflags 2.8.0",
"errno",
"libc",
"linux-raw-sys 0.11.0",
"windows-sys 0.61.2",
]
[[package]] [[package]]
name = "rustversion" name = "rustversion"
version = "1.0.19" version = "1.0.19"
@@ -2136,33 +2131,33 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]] [[package]]
name = "softbuffer" name = "softbuffer"
version = "0.4.6" version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18051cdd562e792cad055119e0cdb2cfc137e44e3987532e0f9659a77931bb08" checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3"
dependencies = [ dependencies = [
"as-raw-xcb-connection", "as-raw-xcb-connection",
"bytemuck", "bytemuck",
"cfg_aliases",
"core-graphics",
"drm", "drm",
"fastrand", "fastrand",
"foreign-types",
"js-sys", "js-sys",
"log",
"memmap2", "memmap2",
"objc2 0.5.2", "ndk",
"objc2-foundation 0.2.2", "objc2",
"objc2-core-foundation",
"objc2-core-graphics",
"objc2-foundation",
"objc2-quartz-core", "objc2-quartz-core",
"raw-window-handle 0.6.2", "raw-window-handle 0.6.2",
"redox_syscall", "redox_syscall",
"rustix", "rustix 1.1.3",
"tiny-xlib", "tiny-xlib",
"tracing",
"wasm-bindgen", "wasm-bindgen",
"wayland-backend", "wayland-backend",
"wayland-client", "wayland-client",
"wayland-sys", "wayland-sys",
"web-sys", "web-sys",
"windows-sys 0.59.0", "windows-sys 0.61.2",
"x11rb", "x11rb",
] ]
@@ -2222,11 +2217,11 @@ name = "tao"
version = "0.34.5" version = "0.34.5"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"block2 0.6.0", "block2",
"core-foundation", "core-foundation",
"core-graphics", "core-graphics",
"crossbeam-channel", "crossbeam-channel",
"dispatch", "dispatch2",
"dlopen2", "dlopen2",
"dpi", "dpi",
"env_logger", "env_logger",
@@ -2240,9 +2235,9 @@ dependencies = [
"ndk", "ndk",
"ndk-context", "ndk-context",
"ndk-sys", "ndk-sys",
"objc2 0.6.0", "objc2",
"objc2-app-kit", "objc2-app-kit",
"objc2-foundation 0.3.0", "objc2-foundation",
"once_cell", "once_cell",
"parking_lot", "parking_lot",
"raw-window-handle 0.4.3", "raw-window-handle 0.4.3",
@@ -2536,7 +2531,7 @@ checksum = "056535ced7a150d45159d3a8dc30f91a2e2d588ca0b23f70e56033622b8016f6"
dependencies = [ dependencies = [
"cc", "cc",
"downcast-rs", "downcast-rs",
"rustix", "rustix 0.38.44",
"scoped-tls", "scoped-tls",
"smallvec", "smallvec",
"wayland-sys", "wayland-sys",
@@ -2549,7 +2544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"rustix", "rustix 0.38.44",
"wayland-backend", "wayland-backend",
"wayland-scanner", "wayland-scanner",
] ]
@@ -2633,7 +2628,7 @@ dependencies = [
"windows-collections", "windows-collections",
"windows-core", "windows-core",
"windows-future", "windows-future",
"windows-link", "windows-link 0.1.1",
"windows-numerics", "windows-numerics",
] ]
@@ -2654,7 +2649,7 @@ checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
dependencies = [ dependencies = [
"windows-implement", "windows-implement",
"windows-interface", "windows-interface",
"windows-link", "windows-link 0.1.1",
"windows-result", "windows-result",
"windows-strings", "windows-strings",
] ]
@@ -2666,7 +2661,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32" checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32"
dependencies = [ dependencies = [
"windows-core", "windows-core",
"windows-link", "windows-link 0.1.1",
] ]
[[package]] [[package]]
@@ -2697,6 +2692,12 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
[[package]]
name = "windows-link"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
[[package]] [[package]]
name = "windows-numerics" name = "windows-numerics"
version = "0.2.0" version = "0.2.0"
@@ -2704,7 +2705,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
dependencies = [ dependencies = [
"windows-core", "windows-core",
"windows-link", "windows-link 0.1.1",
] ]
[[package]] [[package]]
@@ -2713,7 +2714,7 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
dependencies = [ dependencies = [
"windows-link", "windows-link 0.1.1",
] ]
[[package]] [[package]]
@@ -2722,7 +2723,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97"
dependencies = [ dependencies = [
"windows-link", "windows-link 0.1.1",
] ]
[[package]] [[package]]
@@ -2743,6 +2744,15 @@ dependencies = [
"windows-targets 0.52.6", "windows-targets 0.52.6",
] ]
[[package]]
name = "windows-sys"
version = "0.61.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
dependencies = [
"windows-link 0.2.1",
]
[[package]] [[package]]
name = "windows-targets" name = "windows-targets"
version = "0.42.2" version = "0.42.2"
@@ -2795,7 +2805,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e04a5c6627e310a23ad2358483286c7df260c964eb2d003d8efd6d0f4e79265c" checksum = "e04a5c6627e310a23ad2358483286c7df260c964eb2d003d8efd6d0f4e79265c"
dependencies = [ dependencies = [
"windows-link", "windows-link 0.1.1",
] ]
[[package]] [[package]]
@@ -2983,7 +2993,7 @@ dependencies = [
"libc", "libc",
"libloading", "libloading",
"once_cell", "once_cell",
"rustix", "rustix 0.38.44",
"x11rb-protocol", "x11rb-protocol",
] ]

View File

@@ -4,48 +4,52 @@ version = "0.34.5"
description = "Cross-platform window manager library." description = "Cross-platform window manager library."
authors = [ authors = [
"Tauri Programme within The Commons Conservancy", "Tauri Programme within The Commons Conservancy",
"The winit contributors" "The winit contributors",
] ]
edition = "2021" edition = "2021"
rust-version = "1.74" rust-version = "1.74"
keywords = [ "windowing" ] keywords = ["windowing"]
license = "Apache-2.0" license = "Apache-2.0"
readme = "README.md" readme = "README.md"
repository = "https://github.com/tauri-apps/tao" repository = "https://github.com/tauri-apps/tao"
documentation = "https://docs.rs/tao" documentation = "https://docs.rs/tao"
categories = [ "gui" ] categories = ["gui"]
include = ["/README.md", "src/**/*.rs", "examples/**/*.rs", "LICENSE*"] include = ["/README.md", "src/**/*.rs", "examples/**/*.rs", "LICENSE*"]
[package.metadata.docs.rs] [package.metadata.docs.rs]
features = [ "rwh_04", "rwh_05", "rwh_06", "serde", "x11" ] features = ["rwh_04", "rwh_05", "rwh_06", "serde", "x11"]
default-target = "x86_64-unknown-linux-gnu" default-target = "x86_64-unknown-linux-gnu"
targets = [ targets = [
"i686-pc-windows-msvc", "i686-pc-windows-msvc",
"x86_64-pc-windows-msvc", "x86_64-pc-windows-msvc",
"i686-unknown-linux-gnu", "i686-unknown-linux-gnu",
"x86_64-unknown-linux-gnu", "x86_64-unknown-linux-gnu",
"x86_64-apple-darwin" "x86_64-apple-darwin",
] ]
[features] [features]
default = [ "rwh_06", "x11" ] default = ["rwh_06", "x11"]
serde = [ "dep:serde", "dpi/serde" ] serde = ["dep:serde", "dpi/serde"]
rwh_04 = [ "dep:rwh_04" ] rwh_04 = ["dep:rwh_04"]
rwh_05 = [ "dep:rwh_05" ] rwh_05 = ["dep:rwh_05"]
rwh_06 = [ "dep:rwh_06" ] rwh_06 = ["dep:rwh_06"]
x11 = [ "dep:gdkx11-sys", "dep:x11-dl" ] x11 = ["dep:gdkx11-sys", "dep:x11-dl"]
[workspace] [workspace]
members = [ "tao-macros" ] members = ["tao-macros"]
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
log = "0.4" log = "0.4"
once_cell = "1" once_cell = "1"
serde = { version = "1", optional = true, features = [ "serde_derive" ] } serde = { version = "1", optional = true, features = ["serde_derive"] }
rwh_04 = { package = "raw-window-handle", version = "0.4", optional = true } rwh_04 = { package = "raw-window-handle", version = "0.4", optional = true }
rwh_05 = { package = "raw-window-handle", version = "0.5", features = [ "std" ], optional = true } rwh_05 = { package = "raw-window-handle", version = "0.5", features = [
rwh_06 = { package = "raw-window-handle", version = "0.6", features = [ "std" ], optional = true } "std",
], optional = true }
rwh_06 = { package = "raw-window-handle", version = "0.6", features = [
"std",
], optional = true }
bitflags = "2" bitflags = "2"
crossbeam-channel = "0.5" crossbeam-channel = "0.5"
url = "2" url = "2"
@@ -64,9 +68,9 @@ unicode-segmentation = "1.11"
windows-version = "0.1" windows-version = "0.1"
windows-core = "0.61" windows-core = "0.61"
[target."cfg(target_os = \"windows\")".dependencies.windows] [target."cfg(target_os = \"windows\")".dependencies.windows]
version = "0.61" version = "0.61"
features = [ features = [
"Win32_Devices_HumanInterfaceDevice", "Win32_Devices_HumanInterfaceDevice",
"Win32_Foundation", "Win32_Foundation",
"Win32_Globalization", "Win32_Globalization",
@@ -93,7 +97,7 @@ windows-core = "0.61"
"Win32_UI_Input_Touch", "Win32_UI_Input_Touch",
"Win32_UI_Shell", "Win32_UI_Shell",
"Win32_UI_TextServices", "Win32_UI_TextServices",
"Win32_UI_WindowsAndMessaging" "Win32_UI_WindowsAndMessaging",
] ]
[target."cfg(target_os = \"android\")".dependencies] [target."cfg(target_os = \"android\")".dependencies]
@@ -140,11 +144,11 @@ objc2-app-kit = { version = "0.3", default-features = false, features = [
"NSScreen", "NSScreen",
"NSView", "NSView",
"NSWindow", "NSWindow",
"NSUserActivity" "NSUserActivity",
] } ] }
core-foundation = "0.10" core-foundation = "0.10"
core-graphics = "0.24" core-graphics = "0.25"
dispatch = "0.2" dispatch2 = "0.3"
scopeguard = "1.2" scopeguard = "1.2"
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]

View File

@@ -8,7 +8,7 @@ use std::{
}; };
use core_graphics::base::CGFloat; use core_graphics::base::CGFloat;
use dispatch::Queue; use dispatch2::{DispatchQueue, DispatchQueueAttr};
use objc2::{rc::autoreleasepool, Message}; use objc2::{rc::autoreleasepool, Message};
use objc2_app_kit::{NSScreen, NSView, NSWindow, NSWindowStyleMask}; use objc2_app_kit::{NSScreen, NSView, NSWindow, NSWindowStyleMask};
use objc2_foundation::{MainThreadMarker, NSPoint, NSSize, NSString}; use objc2_foundation::{MainThreadMarker, NSPoint, NSSize, NSString};
@@ -40,11 +40,11 @@ impl<T> Deref for MainThreadSafe<T> {
} }
} }
fn run_on_main<R: Send>(f: impl FnOnce() -> R + Send) -> R { fn run_on_main<F: Send + FnOnce()>(f: F) {
if is_main_thread() { if is_main_thread() {
f() f();
} else { } else {
Queue::main().exec_sync(f) DispatchQueue::main().exec_sync(f);
} }
} }
@@ -66,7 +66,7 @@ pub unsafe fn set_style_mask_async(
) { ) {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
let ns_view = MainThreadSafe(ns_view.retain()); let ns_view = MainThreadSafe(ns_view.retain());
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
set_style_mask(&ns_window, &ns_view, mask); set_style_mask(&ns_window, &ns_view, mask);
}); });
} }
@@ -76,7 +76,7 @@ pub unsafe fn set_style_mask_sync(ns_window: &NSWindow, ns_view: &NSView, mask:
} else { } else {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
let ns_view = MainThreadSafe(ns_view.retain()); let ns_view = MainThreadSafe(ns_view.retain());
Queue::main().exec_sync(move || { DispatchQueue::main().exec_sync(move || {
set_style_mask(&ns_window, &ns_view, mask); set_style_mask(&ns_window, &ns_view, mask);
}) })
} }
@@ -86,7 +86,7 @@ pub unsafe fn set_style_mask_sync(ns_window: &NSWindow, ns_view: &NSView, mask:
// and just fails silently. Anyway, GCD to the rescue! // and just fails silently. Anyway, GCD to the rescue!
pub unsafe fn set_content_size_async(ns_window: &NSWindow, size: LogicalSize<f64>) { pub unsafe fn set_content_size_async(ns_window: &NSWindow, size: LogicalSize<f64>) {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
ns_window.setContentSize(NSSize::new(size.width as CGFloat, size.height as CGFloat)); ns_window.setContentSize(NSSize::new(size.width as CGFloat, size.height as CGFloat));
}); });
} }
@@ -95,7 +95,7 @@ pub unsafe fn set_content_size_async(ns_window: &NSWindow, size: LogicalSize<f64
// to log errors. // to log errors.
pub unsafe fn set_frame_top_left_point_async(ns_window: &NSWindow, point: NSPoint) { pub unsafe fn set_frame_top_left_point_async(ns_window: &NSWindow, point: NSPoint) {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
ns_window.setFrameTopLeftPoint(point); ns_window.setFrameTopLeftPoint(point);
}); });
} }
@@ -103,7 +103,7 @@ pub unsafe fn set_frame_top_left_point_async(ns_window: &NSWindow, point: NSPoin
// `setFrameTopLeftPoint:` isn't thread-safe, and fails silently. // `setFrameTopLeftPoint:` isn't thread-safe, and fails silently.
pub unsafe fn set_level_async(ns_window: &NSWindow, level: ffi::NSWindowLevel) { pub unsafe fn set_level_async(ns_window: &NSWindow, level: ffi::NSWindowLevel) {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
ns_window.setLevel(level as _); ns_window.setLevel(level as _);
}); });
} }
@@ -119,7 +119,7 @@ pub unsafe fn toggle_full_screen_async(
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
let ns_view = MainThreadSafe(ns_view.retain()); let ns_view = MainThreadSafe(ns_view.retain());
let shared_state = MainThreadSafe(shared_state); let shared_state = MainThreadSafe(shared_state);
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
// `toggleFullScreen` doesn't work if the `StyleMask` is none, so we // `toggleFullScreen` doesn't work if the `StyleMask` is none, so we
// set a normal style temporarily. The previous state will be // set a normal style temporarily. The previous state will be
// restored in `WindowDelegate::window_did_exit_fullscreen`. // restored in `WindowDelegate::window_did_exit_fullscreen`.
@@ -145,7 +145,7 @@ pub unsafe fn toggle_full_screen_async(
} }
pub unsafe fn restore_display_mode_async(ns_screen: u32) { pub unsafe fn restore_display_mode_async(ns_screen: u32) {
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
ffi::CGRestorePermanentDisplayConfiguration(); ffi::CGRestorePermanentDisplayConfiguration();
assert_eq!(ffi::CGDisplayRelease(ns_screen), ffi::kCGErrorSuccess); assert_eq!(ffi::CGDisplayRelease(ns_screen), ffi::kCGErrorSuccess);
}); });
@@ -160,7 +160,7 @@ pub unsafe fn set_maximized_async(
) { ) {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
let shared_state = MainThreadSafe(shared_state); let shared_state = MainThreadSafe(shared_state);
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
if let Some(shared_state) = shared_state.upgrade() { if let Some(shared_state) = shared_state.upgrade() {
trace!("Locked shared state in `set_maximized`"); trace!("Locked shared state in `set_maximized`");
let mut shared_state_lock = shared_state.lock().unwrap(); let mut shared_state_lock = shared_state.lock().unwrap();
@@ -221,7 +221,7 @@ pub unsafe fn make_key_and_order_front_sync(ns_window: &NSWindow) {
// thread // thread
pub unsafe fn set_title_async(ns_window: &NSWindow, title: String) { pub unsafe fn set_title_async(ns_window: &NSWindow, title: String) {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
let title = NSString::from_str(&title); let title = NSString::from_str(&title);
ns_window.setTitle(&title); ns_window.setTitle(&title);
}); });
@@ -251,7 +251,7 @@ pub unsafe fn close_async(ns_window: &NSWindow) {
// `setIgnoresMouseEvents_:` isn't thread-safe, and fails silently. // `setIgnoresMouseEvents_:` isn't thread-safe, and fails silently.
pub unsafe fn set_ignore_mouse_events(ns_window: &NSWindow, ignore: bool) { pub unsafe fn set_ignore_mouse_events(ns_window: &NSWindow, ignore: bool) {
let ns_window = MainThreadSafe(ns_window.retain()); let ns_window = MainThreadSafe(ns_window.retain());
Queue::main().exec_async(move || { DispatchQueue::main().exec_async(move || {
ns_window.setIgnoresMouseEvents(ignore); ns_window.setIgnoresMouseEvents(ignore);
}); });
} }

View File

@@ -3,7 +3,7 @@ name = "tao-macros"
description = "Proc macros for tao" description = "Proc macros for tao"
version = "0.1.3" version = "0.1.3"
edition = "2021" edition = "2021"
authors = [ "Tauri Programme within The Commons Conservancy" ] authors = ["Tauri Programme within The Commons Conservancy"]
rust-version = "1.74" rust-version = "1.74"
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "../README.md" readme = "../README.md"
@@ -14,9 +14,9 @@ documentation = "https://docs.rs/tao-macros"
proc-macro = true proc-macro = true
[features] [features]
default = [ ] default = []
[dependencies] [dependencies]
proc-macro2 = "1" proc-macro2 = "1"
quote = "1" quote = "1"
syn = { version = "2", features = [ "full" ] } syn = { version = "2", features = ["full"] }