From bdac70b36dd3e17c5f0d7fda49335a5253377dc0 Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Sun, 5 Jan 2025 03:44:23 -0500 Subject: [PATCH] starting over! --- .gitignore | 2 + proto/uri_shell.xml | 9 +- rust/Cargo.lock | 413 +++++++++++++++++++++-------------- rust/Cargo.toml | 23 +- rust/src/main.rs | 2 + rust/src/state.rs | 104 +++++++++ rust/tabbde-core/Cargo.toml | 9 - rust/tabbde-core/src/lib.rs | 0 rust/tabbde-proto/Cargo.toml | 9 - rust/tabbde-proto/src/lib.rs | 14 -- rust/urish/Cargo.toml | 11 + rust/urish/src/lib.rs | 25 +++ 12 files changed, 419 insertions(+), 202 deletions(-) create mode 100644 .gitignore create mode 100644 rust/src/state.rs delete mode 100644 rust/tabbde-core/Cargo.toml delete mode 100644 rust/tabbde-core/src/lib.rs delete mode 100644 rust/tabbde-proto/Cargo.toml delete mode 100644 rust/tabbde-proto/src/lib.rs create mode 100644 rust/urish/Cargo.toml create mode 100644 rust/urish/src/lib.rs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bcc52fe --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +target/ diff --git a/proto/uri_shell.xml b/proto/uri_shell.xml index 16a1fec..e62002a 100644 --- a/proto/uri_shell.xml +++ b/proto/uri_shell.xml @@ -63,8 +63,8 @@ - - + + @@ -103,7 +103,6 @@ - @@ -227,5 +226,9 @@ + + + + diff --git a/rust/Cargo.lock b/rust/Cargo.lock index c0bfe65..7ffe3b1 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -113,18 +113,18 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcfcc3cd946cb52f0bbfdbbcfa2f4e24f75ebb6c0e1002f7c25904fada18b9ec" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" dependencies = [ "proc-macro2", "quote", @@ -139,9 +139,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "calloop" @@ -159,9 +159,9 @@ dependencies = [ [[package]] name = "calloop" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ead1e1514bce44c0f40e027899fbc595907fc112635bed21b3b5d975c0a5e7" +checksum = "10929724661d1c43856fd87c7a127ae944ec55579134fb485e4136fb6a46fdcb" dependencies = [ "bitflags 2.6.0", "polling", @@ -178,15 +178,15 @@ checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" dependencies = [ "calloop 0.13.0", "rustix", - "wayland-backend", - "wayland-client", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "cc" -version = "1.1.28" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "jobserver", "libc", @@ -282,9 +282,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "cursor-icon" @@ -321,14 +321,15 @@ checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53" [[package]] name = "drm" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d000ffcf7a146ee52444a31b78ac82f981ebba5de6fb19f0b1052d98c8e5f308" +checksum = "80bc8c5c6c2941f70a55c15f8d9f00f9710ebda3ffda98075f996a0e6c92756f" dependencies = [ "bitflags 2.6.0", "bytemuck", "drm-ffi", "drm-fourcc", + "libc", "rustix", ] @@ -360,9 +361,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -375,19 +376,19 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "foreign-types" @@ -418,9 +419,9 @@ checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" [[package]] name = "gbm" -version = "0.16.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c724107aa10444b1d2709aae4727c18a33c16b3e15ea8a46cc4ae226c084c88a" +checksum = "ce852e998d3ca5e4a97014fb31c940dc5ef344ec7d364984525fd11e8a547e6a" dependencies = [ "bitflags 2.6.0", "drm", @@ -431,9 +432,9 @@ dependencies = [ [[package]] name = "gbm-sys" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9cc2f64de9fa707b5c6b2d2f10d7a7e49e845018a9f5685891eb40d3bab2538" +checksum = "c13a5f2acc785d8fb6bf6b7ab6bfb0ef5dad4f4d97e8e70bb8e470722312f76f" dependencies = [ "libc", ] @@ -472,9 +473,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "hermit-abi" @@ -490,9 +491,9 @@ checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -529,9 +530,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" +checksum = "06432fb54d3be7964ecd3649233cddf80db2832f47fec34c01f65b3d9d774983" [[package]] name = "jni" @@ -566,10 +567,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -581,15 +583,15 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", "windows-targets 0.52.6", @@ -597,13 +599,13 @@ dependencies = [ [[package]] name = "libredox" -version = "0.0.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall", + "redox_syscall 0.5.8", ] [[package]] @@ -940,9 +942,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "orbclient" -version = "0.3.47" +version = "0.3.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" +checksum = "ba0b26cec2e24f08ed8bb31519a9333140a6599b867dac464bb150bdb796fd43" dependencies = [ "libredox", ] @@ -961,18 +963,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", @@ -981,15 +983,15 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pixman" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24a24da0bec14f4e43a495c1837a3c358b87532e7fe66bd75c348b89f0451b6" +checksum = "cea217d496c19ac0a8e502b37078e1f683d16344adee9eb247a5d57c165e1edf" dependencies = [ "drm-fourcc", "paste", @@ -1011,9 +1013,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", @@ -1044,27 +1046,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" dependencies = [ "profiling-procmacros", ] [[package]] name = "profiling-procmacros" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" +checksum = "a65f2e60fbf1063868558d69c6beacf412dc755f9fc020f514b7955fc914fe30" dependencies = [ "quote", "syn", @@ -1079,11 +1081,20 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.37.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165859e9e55f79d67b96c5d96f4e88b6f2695a1972849c15a6a3f5c59fc2c003" +dependencies = [ + "memchr", +] + [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1133,17 +1144,26 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1169,18 +1189,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -1211,12 +1231,12 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smithay" version = "0.3.0" -source = "git+https://github.com/Smithay/smithay.git#df79eeba63a8e9c2d33b9be2418aee6a940135e7" +source = "git+https://github.com/Smithay/smithay.git#b595a1ca601b77d8bbcf6755602d6f18f2379eac" dependencies = [ "appendlist", "ash", "bitflags 2.6.0", - "calloop 0.14.1", + "calloop 0.14.2", "cc", "cgmath", "cursor-icon", @@ -1245,13 +1265,13 @@ dependencies = [ "thiserror", "tracing", "udev", - "wayland-client", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-cursor", "wayland-egl", "wayland-protocols", "wayland-protocols-misc", "wayland-protocols-wlr", - "wayland-server", + "wayland-server 0.31.6 (registry+https://github.com/rust-lang/crates.io-index)", "winit", "x11rb", "xkbcommon", @@ -1272,13 +1292,13 @@ dependencies = [ "memmap2", "rustix", "thiserror", - "wayland-backend", - "wayland-client", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-csd-frame", "wayland-cursor", "wayland-protocols", "wayland-protocols-wlr", - "wayland-scanner", + "wayland-scanner 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", "xkeysym", ] @@ -1293,9 +1313,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -1306,25 +1326,24 @@ dependencies = [ name = "tabbde" version = "0.0.1" dependencies = [ + "bitflags 2.6.0", "smithay", + "urish", + "wayland-backend 0.3.7 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-client 0.31.7 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-scanner 0.31.5 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-server 0.31.6 (git+https://github.com/Smithay/wayland-rs.git)", ] -[[package]] -name = "tabbde-core" -version = "0.1.0" - -[[package]] -name = "tabbde-proto" -version = "0.1.0" - [[package]] name = "tempfile" -version = "3.13.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -1332,18 +1351,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -1369,9 +1388,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -1381,9 +1400,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", @@ -1392,18 +1411,18 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] [[package]] name = "udev" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba005bcd5b1158ae3cd815905990e8b6ee4ba9ee7adbab6d7b58d389ad09c93" +checksum = "e3d5c197b95f1769931c89f85c33c407801d1fb7a311113bc0b39ad036f1bd81" dependencies = [ "io-lifetimes 1.0.11", "libc", @@ -1413,9 +1432,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" @@ -1423,6 +1442,17 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +[[package]] +name = "urish" +version = "0.1.0" +dependencies = [ + "bitflags 2.6.0", + "wayland-backend 0.3.7 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-client 0.31.7 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-scanner 0.31.5 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-server 0.31.6 (git+https://github.com/Smithay/wayland-rs.git)", +] + [[package]] name = "version_check" version = "0.9.5" @@ -1447,9 +1477,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -1458,13 +1488,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn", @@ -1473,21 +1502,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1495,9 +1525,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -1508,9 +1538,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wayland-backend" @@ -1523,19 +1553,42 @@ dependencies = [ "rustix", "scoped-tls", "smallvec", - "wayland-sys", + "wayland-sys 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-backend" +version = "0.3.7" +source = "git+https://github.com/Smithay/wayland-rs.git#c65ff18c6babb67e52fe55f213d263ee7713e7f8" +dependencies = [ + "cc", + "downcast-rs", + "rustix", + "smallvec", + "wayland-sys 0.31.5 (git+https://github.com/Smithay/wayland-rs.git)", ] [[package]] name = "wayland-client" -version = "0.31.6" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d" +checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ "bitflags 2.6.0", "rustix", - "wayland-backend", - "wayland-scanner", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-client" +version = "0.31.7" +source = "git+https://github.com/Smithay/wayland-rs.git#c65ff18c6babb67e52fe55f213d263ee7713e7f8" +dependencies = [ + "bitflags 2.6.0", + "rustix", + "wayland-backend 0.3.7 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-scanner 0.31.5 (git+https://github.com/Smithay/wayland-rs.git)", ] [[package]] @@ -1546,17 +1599,17 @@ checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ "bitflags 2.6.0", "cursor-icon", - "wayland-backend", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-cursor" -version = "0.31.6" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a94697e66e76c85923b0d28a0c251e8f0666f58fc47d316c0f4da6da75d37cb" +checksum = "32b08bc3aafdb0035e7fe0fdf17ba0c09c268732707dca4ae098f60cb28c9e4c" dependencies = [ "rustix", - "wayland-client", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", "xcursor", ] @@ -1566,61 +1619,61 @@ version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e3cb8b84ff95310fe59ce6c61f1fa344ec22f4c240c369a2b20f15caebfede4" dependencies = [ - "wayland-backend", - "wayland-sys", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-protocols" -version = "0.32.4" +version = "0.32.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5755d77ae9040bb872a25026555ce4cb0ae75fd923e90d25fba07d81057de0" +checksum = "7cd0ade57c4e6e9a8952741325c30bf82f4246885dca8bf561898b86d0c1f58e" dependencies = [ "bitflags 2.6.0", - "wayland-backend", - "wayland-client", - "wayland-scanner", - "wayland-server", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-server 0.31.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-protocols-misc" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40dd9d2f7f2713724d84b920d6f73ff878f6a353712942f75f78f4dadb72886" +checksum = "da2e42969764e469a115d4bb1c16e9588ef8b75b127ba7a2c9ddf1e140b25ca7" dependencies = [ "bitflags 2.6.0", - "wayland-backend", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-protocols", - "wayland-scanner", - "wayland-server", + "wayland-scanner 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-server 0.31.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-protocols-plasma" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0a41a6875e585172495f7a96dfa42ca7e0213868f4f15c313f7c33221a7eff" +checksum = "9b31cab548ee68c7eb155517f2212049dc151f7cd7910c2b66abfd31c3ee12bd" dependencies = [ "bitflags 2.6.0", - "wayland-backend", - "wayland-client", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-protocols", - "wayland-scanner", + "wayland-scanner 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-protocols-wlr" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad87b5fd1b1d3ca2f792df8f686a2a11e3fe1077b71096f7a175ab699f89109" +checksum = "782e12f6cd923c3c316130d56205ebab53f55d6666b7faddfad36cecaeeb4022" dependencies = [ "bitflags 2.6.0", - "wayland-backend", - "wayland-client", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-protocols", - "wayland-scanner", - "wayland-server", + "wayland-scanner 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-server 0.31.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1630,22 +1683,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" dependencies = [ "proc-macro2", - "quick-xml", + "quick-xml 0.36.2", "quote", ] [[package]] -name = "wayland-server" +name = "wayland-scanner" version = "0.31.5" +source = "git+https://github.com/Smithay/wayland-rs.git#c65ff18c6babb67e52fe55f213d263ee7713e7f8" +dependencies = [ + "proc-macro2", + "quick-xml 0.37.2", + "quote", +] + +[[package]] +name = "wayland-server" +version = "0.31.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f18d47038c0b10479e695d99ed073e400ccd9bdbb60e6e503c96f62adcb12b6" +checksum = "c89532cc712a2adb119eb4d09694b402576052254d0bb284f82ac1c47fb786ad" +dependencies = [ + "bitflags 2.6.0", + "downcast-rs", + "io-lifetimes 2.0.4", + "rustix", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.31.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wayland-server" +version = "0.31.6" +source = "git+https://github.com/Smithay/wayland-rs.git#c65ff18c6babb67e52fe55f213d263ee7713e7f8" dependencies = [ "bitflags 2.6.0", "downcast-rs", - "io-lifetimes 2.0.3", "rustix", - "wayland-backend", - "wayland-scanner", + "wayland-backend 0.3.7 (git+https://github.com/Smithay/wayland-rs.git)", + "wayland-scanner 0.31.5 (git+https://github.com/Smithay/wayland-rs.git)", ] [[package]] @@ -1660,11 +1735,19 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "wayland-sys" +version = "0.31.5" +source = "git+https://github.com/Smithay/wayland-rs.git#c65ff18c6babb67e52fe55f213d263ee7713e7f8" +dependencies = [ + "pkg-config", +] + [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -1905,9 +1988,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" -version = "0.30.5" +version = "0.30.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0be9e76a1f1077e04a411f0b989cbd3c93339e1771cb41e71ac4aee95bfd2c67" +checksum = "f5d74280aabb958072864bff6cfbcf9025cf8bfacdde5e32b5e12920ef703b0f" dependencies = [ "ahash", "android-activity", @@ -1934,7 +2017,7 @@ dependencies = [ "percent-encoding", "pin-project", "raw-window-handle", - "redox_syscall", + "redox_syscall 0.4.1", "rustix", "smithay-client-toolkit", "smol_str", @@ -1942,8 +2025,8 @@ dependencies = [ "unicode-segmentation", "wasm-bindgen", "wasm-bindgen-futures", - "wayland-backend", - "wayland-client", + "wayland-backend 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.31.7 (registry+https://github.com/rust-lang/crates.io-index)", "wayland-protocols", "wayland-protocols-plasma", "web-sys", @@ -1956,9 +2039,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" dependencies = [ "memchr", ] @@ -2033,9 +2116,9 @@ checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "xml-rs" -version = "0.8.22" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" +checksum = "ea8b391c9a790b496184c29f7f93b9ed5b16abb306c05415b68bcc16e4d06432" [[package]] name = "zerocopy" diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 3b60c64..47e7485 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -4,17 +4,36 @@ version = "0.0.1" edition = "2021" [dependencies] +bitflags = "2.6.0" [dependencies.smithay] git = "https://github.com/Smithay/smithay.git" - +[dependencies.wayland-scanner] +git = "https://github.com/Smithay/wayland-rs.git" +[dependencies.wayland-server] +git = "https://github.com/Smithay/wayland-rs.git" +[dependencies.wayland-client] +git = "https://github.com/Smithay/wayland-rs.git" +[dependencies.wayland-backend] +git = "https://github.com/Smithay/wayland-rs.git" +[dependencies.urish] +path="./urish" [workspace] -members = ["tabbde-core", "tabbde-proto"] +members = ["urish"] [workspace.dependencies] +bitflags = "2.6.0" [workspace.dependencies.smithay] git = "https://github.com/Smithay/smithay.git" +[workspace.dependencies.wayland-scanner] +git = "https://github.com/Smithay/wayland-rs.git" +[workspace.dependencies.wayland-server] +git = "https://github.com/Smithay/wayland-rs.git" +[workspace.dependencies.wayland-client] +git = "https://github.com/Smithay/wayland-rs.git" +[workspace.dependencies.wayland-backend] +git = "https://github.com/Smithay/wayland-rs.git" diff --git a/rust/src/main.rs b/rust/src/main.rs index f328e4d..b6cfe31 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -1 +1,3 @@ +mod state; + fn main() {} diff --git a/rust/src/state.rs b/rust/src/state.rs new file mode 100644 index 0000000..93e613c --- /dev/null +++ b/rust/src/state.rs @@ -0,0 +1,104 @@ +use std::collections::HashMap; +use std::ffi::OsString; +use std::os::unix::net::UnixStream; +use std::os::fd::{AsRawFd, RawFd}; +use std::process::Command; +use std::sync::{Arc, RwLock}; + + +use smithay::{ + desktop::{PopupManager, Space, Window, WindowSurfaceType}, + input::{Seat, SeatState}, + reexports::{ + wayland_server::{ + backend::{ClientData, ClientId, DisconnectReason}, + }, + calloop::{generic::Generic, EventLoop, Interest, LoopSignal, Mode, PostAction, RegistrationToken} + }, + wayland::{ + socket::ListeningSocketSource, + }, +}; + +pub struct TabbDE { + pub start_time: std::time::Instant, + + pub client_contexts: HashMap> +} + +impl TabbDE { + pub fn new(event_loop: &mut EventLoop) -> Self { + let start_time = std::time::Instant::now(); + + Self { + start_time, + client_contexts: Default::default(), + } + } + + pub fn init_subprocess(&mut self, event_loop: &mut EventLoop, command: &mut Command) { + let created_time = std::time::Instant::now(); + + let listening_socket = ListeningSocketSource::new_auto().unwrap(); + let socket_name = listening_socket.socket_name().to_os_string(); + command.env("WAYLAND_DISPLAY", &socket_name); + + let loop_handle = event_loop.handle(); + let listener_token = loop_handle + .insert_source(listening_socket, move |client_stream, _, state| { + let addr = client_stream + .local_addr() + .unwrap(); + let path = addr + .as_pathname() + .unwrap() + .as_os_str(); + + let fd = client_stream.as_raw_fd(); + let context = ClientConnection { + created_time: std::time::Instant::now(), + client_stream + }; + + state + .client_contexts[path] + .as_ref() + .connections + .write() + .expect("Couldn't lock state.client_contexts[].connection") + .insert(fd, context); + }) + .expect("Failed to init the wayland event source."); + + let context = ClientContext { + socket_name: socket_name.clone(), + created_time, + + listener_token, + + connections: Default::default() + }; + + self.client_contexts.insert(socket_name, Arc::new(context)); + + command + .spawn() + .expect("Couldn't open subprocess"); + + command.env_remove("WAYLAND_DISPLAY"); + } +} + +pub struct ClientContext { + pub socket_name: OsString, + pub created_time: std::time::Instant, + + pub listener_token: RegistrationToken, + + pub connections: RwLock> +} + +pub struct ClientConnection { + pub created_time: std::time::Instant, + pub client_stream: UnixStream +} diff --git a/rust/tabbde-core/Cargo.toml b/rust/tabbde-core/Cargo.toml deleted file mode 100644 index c7d2b41..0000000 --- a/rust/tabbde-core/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "tabbde-core" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["lib"] - -[dependencies] diff --git a/rust/tabbde-core/src/lib.rs b/rust/tabbde-core/src/lib.rs deleted file mode 100644 index e69de29..0000000 diff --git a/rust/tabbde-proto/Cargo.toml b/rust/tabbde-proto/Cargo.toml deleted file mode 100644 index 7a4049e..0000000 --- a/rust/tabbde-proto/Cargo.toml +++ /dev/null @@ -1,9 +0,0 @@ -[package] -name = "tabbde-proto" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["lib"] - -[dependencies] diff --git a/rust/tabbde-proto/src/lib.rs b/rust/tabbde-proto/src/lib.rs deleted file mode 100644 index b93cf3f..0000000 --- a/rust/tabbde-proto/src/lib.rs +++ /dev/null @@ -1,14 +0,0 @@ -pub fn add(left: u64, right: u64) -> u64 { - left + right -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn it_works() { - let result = add(2, 2); - assert_eq!(result, 4); - } -} diff --git a/rust/urish/Cargo.toml b/rust/urish/Cargo.toml new file mode 100644 index 0000000..7f37fa0 --- /dev/null +++ b/rust/urish/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "urish" +version = "0.1.0" +edition = "2021" + +[dependencies] +bitflags = { workspace = true } +wayland-client = { workspace = true } +wayland-server = { workspace = true } +wayland-scanner = { workspace = true } +wayland-backend = { workspace = true } diff --git a/rust/urish/src/lib.rs b/rust/urish/src/lib.rs new file mode 100644 index 0000000..c2a9eeb --- /dev/null +++ b/rust/urish/src/lib.rs @@ -0,0 +1,25 @@ +// Generate the bindings in their own modules +pub mod client_proto { + use wayland_client; + use wayland_client::protocol::*; + + pub mod __interfaces { + use wayland_client::protocol::__interfaces::*; + wayland_scanner::generate_interfaces!("../../proto/uri_shell.xml"); + } + use self::__interfaces::*; + + wayland_scanner::generate_client_code!("../../proto/uri_shell.xml"); +} +pub mod server_proto { + use wayland_server; + use wayland_server::protocol::*; + + pub mod __interfaces { + use wayland_server::protocol::__interfaces::*; + wayland_scanner::generate_interfaces!("../../proto/uri_shell.xml"); + } + use self::__interfaces::*; + + wayland_scanner::generate_server_code!("../../proto/uri_shell.xml"); +} -- 2.45.2