Merge pull request #36 from pop-os/workspaces-client-toolkit_jammy
Use `cosmic-client-toolkit` helpers in workspace applet
This commit is contained in:
commit
a38b216924
8 changed files with 192 additions and 366 deletions
122
Cargo.lock
generated
122
Cargo.lock
generated
|
|
@ -103,9 +103,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arc-swap"
|
name = "arc-swap"
|
||||||
version = "1.5.1"
|
version = "1.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "983cd8b9d4b02a6dc6ffa557262eb5858a27a0038ffffe21a0f133eaa819a164"
|
checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayref"
|
name = "arrayref"
|
||||||
|
|
@ -136,9 +136,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-broadcast"
|
name = "async-broadcast"
|
||||||
version = "0.4.1"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6d26004fe83b2d1cd3a97609b21e39f9a31535822210fe83205d2ce48866ea61"
|
checksum = "1b19760fa2b7301cf235360ffd6d3558b1ed4249edd16d6cca8d690cee265b95"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"event-listener",
|
"event-listener",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
|
|
@ -624,6 +624,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"calloop",
|
"calloop",
|
||||||
|
"cosmic-client-toolkit",
|
||||||
"cosmic-protocols",
|
"cosmic-protocols",
|
||||||
"futures",
|
"futures",
|
||||||
"i18n-embed",
|
"i18n-embed",
|
||||||
|
|
@ -634,7 +635,6 @@ dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"pretty_env_logger",
|
"pretty_env_logger",
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"smithay-client-toolkit",
|
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"xdg",
|
"xdg",
|
||||||
|
|
@ -643,7 +643,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-client-toolkit"
|
name = "cosmic-client-toolkit"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-protocols#7d49ce0af1b38c3f2fa24288f5b9275a95440058"
|
source = "git+https://github.com/pop-os/cosmic-protocols#1615d9048198d3beac93184259046cf546d63657"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-protocols",
|
"cosmic-protocols",
|
||||||
"gl_generator",
|
"gl_generator",
|
||||||
|
|
@ -668,7 +668,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-panel-config"
|
name = "cosmic-panel-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-panel?branch=master_jammy#d522b75e2eeff5b2f32a8e47c6ee6a06369b7f9e"
|
source = "git+https://github.com/pop-os/cosmic-panel#9502913468dc7bf1cc17da6c1fcf1e274f43a769"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ron",
|
"ron",
|
||||||
|
|
@ -682,7 +682,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-protocols"
|
name = "cosmic-protocols"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-protocols#7d49ce0af1b38c3f2fa24288f5b9275a95440058"
|
source = "git+https://github.com/pop-os/cosmic-protocols#1615d9048198d3beac93184259046cf546d63657"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
|
|
@ -1839,9 +1839,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "half"
|
name = "half"
|
||||||
version = "2.1.0"
|
version = "2.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ad6a9459c9c30b177b925162351f97e7d967c7ea8bab3b8352805327daf45554"
|
checksum = "6c467d36af040b7b2681f5fddd27427f6da8d3d072f575a265e181d2f8e8d157"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crunchy",
|
"crunchy",
|
||||||
]
|
]
|
||||||
|
|
@ -1996,7 +1996,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
|
|
@ -2013,7 +2013,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_core"
|
name = "iced_core"
|
||||||
version = "0.6.2"
|
version = "0.6.2"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"palette",
|
"palette",
|
||||||
|
|
@ -2023,7 +2023,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_futures"
|
name = "iced_futures"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"log",
|
"log",
|
||||||
|
|
@ -2035,7 +2035,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_glow"
|
name = "iced_glow"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"euclid",
|
"euclid",
|
||||||
|
|
@ -2050,7 +2050,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_graphics"
|
name = "iced_graphics"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2070,7 +2070,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_lazy"
|
name = "iced_lazy"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_native",
|
"iced_native",
|
||||||
"ouroboros 0.13.0",
|
"ouroboros 0.13.0",
|
||||||
|
|
@ -2079,7 +2079,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_native"
|
name = "iced_native"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
|
|
@ -2093,7 +2093,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_sctk"
|
name = "iced_sctk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"enum-repr",
|
"enum-repr",
|
||||||
"futures",
|
"futures",
|
||||||
|
|
@ -2112,7 +2112,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_style"
|
name = "iced_style"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|
@ -2122,7 +2122,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_swbuf"
|
name = "iced_swbuf"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
|
|
@ -2137,7 +2137,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_wgpu"
|
name = "iced_wgpu"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2327,7 +2327,7 @@ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#f84410608b7a62335f197f96125d27d7df5f8a59"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#444e389496bb92a928b7731175f00f51ec4f0caa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"cosmic-panel-config",
|
"cosmic-panel-config",
|
||||||
|
|
@ -2660,9 +2660,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "7.1.1"
|
version = "7.1.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
|
checksum = "e5507769c4919c998e69e49c839d9dc6e693ede4cc4290d6ad8b41d4f09c548c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
"minimal-lexical",
|
"minimal-lexical",
|
||||||
|
|
@ -2760,9 +2760,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.16.0"
|
version = "1.17.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"
|
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ordered-float"
|
name = "ordered-float"
|
||||||
|
|
@ -2785,9 +2785,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ordered-stream"
|
name = "ordered-stream"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "01ca8c99d73c6e92ac1358f9f692c22c0bfd9c4701fa086f5d365c0d4ea818ea"
|
checksum = "d4eb9ba3f3e42dbdd3b7b122de5ca169c81e93d561eb900da3a8c99bcfcf381a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
|
|
@ -3181,9 +3181,9 @@ checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rangemap"
|
name = "rangemap"
|
||||||
version = "1.2.0"
|
version = "1.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4fa20df61fa7daf0ecf0735b9841ced4a0d25962d1b1eb2dd28dcdd37bb688f2"
|
checksum = "8b9283c6b06096b47afc7109834fdedab891175bb5241ee5d4f7d2546549f263"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "raqote"
|
name = "raqote"
|
||||||
|
|
@ -3629,7 +3629,7 @@ checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smithay"
|
name = "smithay"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "git+https://github.com/Smithay/smithay?rev=bcc4ee38b8936f57907c844a5e92cf6c0d7325e3#bcc4ee38b8936f57907c844a5e92cf6c0d7325e3"
|
source = "git+https://github.com/Smithay/smithay?rev=c85e1e5#c85e1e520d14aaaadff1369bcbf88ea8204c0827"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"appendlist",
|
"appendlist",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
|
@ -3659,7 +3659,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "smithay-client-toolkit"
|
name = "smithay-client-toolkit"
|
||||||
version = "0.16.0"
|
version = "0.16.0"
|
||||||
source = "git+https://github.com/Smithay/client-toolkit?rev=73346019952f82ec7e4d4d15f5d66841b54e8b61#73346019952f82ec7e4d4d15f5d66841b54e8b61"
|
source = "git+https://github.com/Smithay/client-toolkit?rev=3776d4a#3776d4aecf5bf94bbe0dc3bae3e64d5a07db7fd6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"calloop",
|
"calloop",
|
||||||
|
|
@ -4329,14 +4329,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-backend"
|
name = "wayland-backend"
|
||||||
version = "0.1.0-beta.14"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "50598bd298e1e01de02ad3cdcfcfcdb961189e40fea41d9325bc07ba81f8740d"
|
checksum = "fb23bfea266c92bb051ea36cce0eb1a52b743dc1c5f168021947eda79764656d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"downcast-rs",
|
"downcast-rs",
|
||||||
"io-lifetimes",
|
"io-lifetimes",
|
||||||
"nix 0.25.1",
|
"nix 0.26.1",
|
||||||
"scoped-tls",
|
"scoped-tls",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"wayland-sys",
|
"wayland-sys",
|
||||||
|
|
@ -4344,35 +4344,32 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-client"
|
name = "wayland-client"
|
||||||
version = "0.30.0-beta.14"
|
version = "0.30.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ae06ffbf163db5cc6b40f9aa0ec66e7e1c22b979a327daf209814277f18834e1"
|
checksum = "1a925bd68c8b652af4e6f11a32410bd31bf84061c5ef279ed081520c60f203b4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"futures-channel",
|
"nix 0.26.1",
|
||||||
"futures-core",
|
|
||||||
"nix 0.25.1",
|
|
||||||
"thiserror",
|
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-cursor"
|
name = "wayland-cursor"
|
||||||
version = "0.30.0-beta.14"
|
version = "0.30.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e0ca2f99754a70feaddd3cb14acb152186db32841b7ac312487788ea33a78b1"
|
checksum = "2d0c3a0d5b4b688b07b0442362d3ed6bf04724fcc16cd69ab6285b90dbc487aa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nix 0.25.1",
|
"nix 0.26.1",
|
||||||
"wayland-client",
|
"wayland-client",
|
||||||
"xcursor",
|
"xcursor",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols"
|
name = "wayland-protocols"
|
||||||
version = "0.30.0-beta.14"
|
version = "0.30.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8491945e2705791d58695ae166bb05bfb1f01f2b7b848faa73966e3462269a2f"
|
checksum = "7fefbeb8a360abe67ab7c2efe1d297a1a50ee011f5460791bc18870c26bb84e2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
|
|
@ -4383,9 +4380,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols-misc"
|
name = "wayland-protocols-misc"
|
||||||
version = "0.1.0-beta.14"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c3065c2e2b1a945d5f1afd549e098b6245cd3409317ef1e35a271dddd5ef4ab3"
|
checksum = "897d4e99645e1ed9245e9e6b5efa78828d2b23b661016d63d55251243d812f8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
|
|
@ -4396,9 +4393,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-protocols-wlr"
|
name = "wayland-protocols-wlr"
|
||||||
version = "0.1.0-beta.14"
|
version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "90968fc47879437fa8519182e07e25eb8173e866767728f2936cd28153f3444c"
|
checksum = "fce991093320e4a6a525876e6b629ab24da25f9baef0c2e0080ad173ec89588a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
|
|
@ -4410,26 +4407,25 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-scanner"
|
name = "wayland-scanner"
|
||||||
version = "0.30.0-beta.14"
|
version = "0.30.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "28407261ad2bab693652acd84e8abcf1d2bef7270b5cc840ec8c6bed7c715838"
|
checksum = "4834c14b3edf1d9986c83ca79b1e7e3afbe9874c7c144702f6467063259ce45d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"quote",
|
"quote",
|
||||||
"syn",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wayland-server"
|
name = "wayland-server"
|
||||||
version = "0.30.0-beta.14"
|
version = "0.30.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "246d94f203cd9b2993f130255e608639a335e57ec59a2e1ff40164ae4ed6ae40"
|
checksum = "9062def387c1b1d80e366d8243c2b3bd6d9e4f343032a3e5da8d4aa03866cf89"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"downcast-rs",
|
"downcast-rs",
|
||||||
"nix 0.25.1",
|
"io-lifetimes",
|
||||||
"thiserror",
|
"nix 0.26.1",
|
||||||
"wayland-backend",
|
"wayland-backend",
|
||||||
"wayland-scanner",
|
"wayland-scanner",
|
||||||
]
|
]
|
||||||
|
|
@ -4740,7 +4736,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xdg-shell-wrapper-config"
|
name = "xdg-shell-wrapper-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/xdg-shell-wrapper?branch=master#1bf60b8eff599ef2ee68d5ce8d46f05b7807ffc6"
|
source = "git+https://github.com/pop-os/xdg-shell-wrapper#82ce268c9c560be3728190a2255c849d3bae77e7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"wayland-protocols-wlr",
|
"wayland-protocols-wlr",
|
||||||
|
|
@ -4789,7 +4785,7 @@ checksum = "c03b3e19c937b5b9bd8e52b1c88f30cce5c0d33d676cf174866175bb794ff658"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus"
|
name = "zbus"
|
||||||
version = "3.6.2"
|
version = "3.6.2"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#9a8617bb8f2d92ef0a0104525f989fff0da4279b"
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-broadcast",
|
"async-broadcast",
|
||||||
"async-executor",
|
"async-executor",
|
||||||
|
|
@ -4826,7 +4822,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus_macros"
|
name = "zbus_macros"
|
||||||
version = "3.6.2"
|
version = "3.6.2"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#9a8617bb8f2d92ef0a0104525f989fff0da4279b"
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
@ -4838,7 +4834,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus_names"
|
name = "zbus_names"
|
||||||
version = "2.5.0"
|
version = "2.5.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#9a8617bb8f2d92ef0a0104525f989fff0da4279b"
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
|
|
@ -4867,7 +4863,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zvariant"
|
name = "zvariant"
|
||||||
version = "3.10.0"
|
version = "3.10.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#9a8617bb8f2d92ef0a0104525f989fff0da4279b"
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"enumflags2",
|
"enumflags2",
|
||||||
|
|
@ -4892,7 +4888,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zvariant_derive"
|
name = "zvariant_derive"
|
||||||
version = "3.10.0"
|
version = "3.10.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#9a8617bb8f2d92ef0a0104525f989fff0da4279b"
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,4 @@ libpulse-binding = "2.26.0"
|
||||||
libpulse-glib-binding = "2.25.0"
|
libpulse-glib-binding = "2.25.0"
|
||||||
tokio = { version = "1.20.1", features=["full"] }
|
tokio = { version = "1.20.1", features=["full"] }
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
||||||
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
|
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "3776d4a" }
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
once_cell = "1.16.0"
|
once_cell = "1.16.0"
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
||||||
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
|
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "3776d4a" }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
zbus = { version = "3.5", no-default-features = true }
|
zbus = { version = "3.5", no-default-features = true }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,5 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
zbus = "3.4"
|
zbus = "3.4"
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
||||||
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
|
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "3776d4a" }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ once_cell = "1.16.0"
|
||||||
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", branch = "deps" }
|
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", branch = "deps" }
|
||||||
futures-util = "0.3.21"
|
futures-util = "0.3.21"
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
||||||
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
|
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "3776d4a" }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
zbus = { version = "3.6.2", no-default-features = true }
|
zbus = { version = "3.6.2", no-default-features = true }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ libpulse-binding = "2.26.0"
|
||||||
libpulse-glib-binding = "2.25.0"
|
libpulse-glib-binding = "2.25.0"
|
||||||
tokio = { version = "1.20.1", features=["full"] }
|
tokio = { version = "1.20.1", features=["full"] }
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
||||||
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
|
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "3776d4a" }
|
||||||
nix = "0.24.1"
|
nix = "0.24.1"
|
||||||
|
|
||||||
# Until the 3.6.3 release, need the implementation of clone on zbus::Error
|
# Until the 3.6.3 release, need the implementation of clone on zbus::Error
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet"] }
|
||||||
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "73346019952f82ec7e4d4d15f5d66841b54e8b61" }
|
cosmic-client-toolkit = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false }
|
||||||
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = ["client"] }
|
cosmic-protocols = { git = "https://github.com/pop-os/cosmic-protocols", default-features = false, features = ["client"] }
|
||||||
wayland-backend = {version = "0.1.0-beta.14", features = ["client_system"]}
|
wayland-backend = {version = "0.1.0-beta.14", features = ["client_system"]}
|
||||||
wayland-client = {version = "0.30.0-beta.14"}
|
wayland-client = {version = "0.30.0-beta.14"}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,24 @@
|
||||||
use calloop::channel::*;
|
use calloop::channel::*;
|
||||||
use cosmic::applet::cosmic_panel_config::CosmicPanelOuput;
|
use cosmic::applet::cosmic_panel_config::CosmicPanelOuput;
|
||||||
use cosmic_protocols::workspace::v1::client::{
|
use cosmic_client_toolkit::{
|
||||||
zcosmic_workspace_group_handle_v1::{self, ZcosmicWorkspaceGroupHandleV1},
|
sctk::{
|
||||||
zcosmic_workspace_handle_v1::{self, ZcosmicWorkspaceHandleV1},
|
self,
|
||||||
zcosmic_workspace_manager_v1::{self, ZcosmicWorkspaceManagerV1},
|
event_loop::WaylandSource,
|
||||||
|
output::{OutputHandler, OutputState},
|
||||||
|
registry::{ProvidesRegistryState, RegistryState},
|
||||||
|
},
|
||||||
|
workspace::{WorkspaceHandler, WorkspaceState},
|
||||||
};
|
};
|
||||||
|
use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1;
|
||||||
use futures::{channel::mpsc, executor::block_on, SinkExt};
|
use futures::{channel::mpsc, executor::block_on, SinkExt};
|
||||||
use sctk::event_loop::WaylandSource;
|
|
||||||
use std::{env, os::unix::net::UnixStream, path::PathBuf, str::FromStr, time::Duration};
|
use std::{env, os::unix::net::UnixStream, path::PathBuf, str::FromStr, time::Duration};
|
||||||
use wayland_backend::client::ObjectId;
|
use wayland_backend::client::ObjectId;
|
||||||
use wayland_client::{
|
use wayland_client::{
|
||||||
event_created_child,
|
globals::registry_queue_init,
|
||||||
protocol::{
|
protocol::wl_output::{self, WlOutput},
|
||||||
wl_output::{self, WlOutput},
|
|
||||||
wl_registry::{self, WlRegistry},
|
|
||||||
},
|
|
||||||
ConnectError, Proxy,
|
ConnectError, Proxy,
|
||||||
};
|
};
|
||||||
use wayland_client::{Connection, Dispatch, QueueHandle};
|
use wayland_client::{Connection, QueueHandle, WEnum};
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum WorkspaceEvent {
|
pub enum WorkspaceEvent {
|
||||||
|
|
@ -42,7 +43,7 @@ pub fn spawn_workspaces(tx: mpsc::Sender<WorkspaceList>) -> SyncSender<Workspace
|
||||||
.and_then(|s| s.map(|s| Connection::from_socket(s).map_err(anyhow::Error::msg)))
|
.and_then(|s| s.map(|s| Connection::from_socket(s).map_err(anyhow::Error::msg)))
|
||||||
{
|
{
|
||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
let output = std::env::var("COSMIC_PANEL_OUTPUT")
|
let configured_output = std::env::var("COSMIC_PANEL_OUTPUT")
|
||||||
.ok()
|
.ok()
|
||||||
.map(|output_str| match CosmicPanelOuput::from_str(&output_str) {
|
.map(|output_str| match CosmicPanelOuput::from_str(&output_str) {
|
||||||
Ok(CosmicPanelOuput::Name(name)) => name,
|
Ok(CosmicPanelOuput::Name(name)) => name,
|
||||||
|
|
@ -51,7 +52,7 @@ pub fn spawn_workspaces(tx: mpsc::Sender<WorkspaceList>) -> SyncSender<Workspace
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let mut event_loop = calloop::EventLoop::<State>::try_new().unwrap();
|
let mut event_loop = calloop::EventLoop::<State>::try_new().unwrap();
|
||||||
let loop_handle = event_loop.handle();
|
let loop_handle = event_loop.handle();
|
||||||
let event_queue = conn.new_event_queue::<State>();
|
let (globals, event_queue) = registry_queue_init(&conn).unwrap();
|
||||||
let qhandle = event_queue.handle();
|
let qhandle = event_queue.handle();
|
||||||
|
|
||||||
WaylandSource::new(event_queue)
|
WaylandSource::new(event_queue)
|
||||||
|
|
@ -59,43 +60,56 @@ pub fn spawn_workspaces(tx: mpsc::Sender<WorkspaceList>) -> SyncSender<Workspace
|
||||||
.insert(loop_handle)
|
.insert(loop_handle)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let display = conn.display();
|
let registry_state = RegistryState::new(&globals);
|
||||||
display.get_registry(&qhandle, ());
|
|
||||||
|
|
||||||
let mut state = State {
|
let mut state = State {
|
||||||
outputs_to_handle: Default::default(),
|
// Must be before `WorkspaceState`
|
||||||
wm_name: None,
|
output_state: OutputState::new(&globals, &qhandle),
|
||||||
workspace_manager: None,
|
configured_output,
|
||||||
workspace_groups: Vec::new(),
|
workspace_state: WorkspaceState::new(®istry_state, &qhandle),
|
||||||
configured_output: output,
|
registry_state,
|
||||||
expected_output: None,
|
expected_output: None,
|
||||||
tx,
|
tx,
|
||||||
running: true,
|
running: true,
|
||||||
|
have_workspaces: false,
|
||||||
};
|
};
|
||||||
let loop_handle = event_loop.handle();
|
let loop_handle = event_loop.handle();
|
||||||
loop_handle
|
loop_handle
|
||||||
.insert_source(workspaces_rx, |e, _, state| match e {
|
.insert_source(workspaces_rx, |e, _, state| match e {
|
||||||
Event::Msg(WorkspaceEvent::Activate(id)) => {
|
Event::Msg(WorkspaceEvent::Activate(id)) => {
|
||||||
if let Some(w) = state.workspace_groups.iter().find_map(|g| {
|
if let Some(w) = state
|
||||||
g.workspaces.iter().find(|w| w.workspace_handle.id() == id)
|
.workspace_state
|
||||||
}) {
|
.workspace_groups()
|
||||||
w.workspace_handle.activate();
|
.iter()
|
||||||
state.workspace_manager.as_ref().unwrap().commit();
|
.find_map(|g| g.workspaces.iter().find(|w| w.handle.id() == id))
|
||||||
|
{
|
||||||
|
w.handle.activate();
|
||||||
|
state
|
||||||
|
.workspace_state
|
||||||
|
.workspace_manager()
|
||||||
|
.get()
|
||||||
|
.unwrap()
|
||||||
|
.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event::Msg(WorkspaceEvent::Scroll(v)) => {
|
Event::Msg(WorkspaceEvent::Scroll(v)) => {
|
||||||
if let Some((w_g, w_i)) = state.workspace_groups.iter().find_map(|g| {
|
if let Some((w_g, w_i)) = state
|
||||||
if g.output != state.expected_output {
|
.workspace_state
|
||||||
return None;
|
.workspace_groups()
|
||||||
}
|
.iter()
|
||||||
g.workspaces
|
.find_map(|g| {
|
||||||
.iter()
|
if g.output != state.expected_output {
|
||||||
.position(|w| {
|
return None;
|
||||||
w.states
|
}
|
||||||
.contains(&zcosmic_workspace_handle_v1::State::Active)
|
g.workspaces
|
||||||
})
|
.iter()
|
||||||
.map(|w_i| (g, w_i))
|
.position(|w| {
|
||||||
}) {
|
w.state.contains(&WEnum::Value(
|
||||||
|
zcosmic_workspace_handle_v1::State::Active,
|
||||||
|
))
|
||||||
|
})
|
||||||
|
.map(|w_i| (g, w_i))
|
||||||
|
})
|
||||||
|
{
|
||||||
let max_w = w_g.workspaces.len().wrapping_sub(1);
|
let max_w = w_g.workspaces.len().wrapping_sub(1);
|
||||||
let d_i = if v > 0.0 {
|
let d_i = if v > 0.0 {
|
||||||
if w_i == max_w {
|
if w_i == max_w {
|
||||||
|
|
@ -111,15 +125,22 @@ pub fn spawn_workspaces(tx: mpsc::Sender<WorkspaceList>) -> SyncSender<Workspace
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if let Some(w) = w_g.workspaces.get(d_i) {
|
if let Some(w) = w_g.workspaces.get(d_i) {
|
||||||
w.workspace_handle.activate();
|
w.handle.activate();
|
||||||
state.workspace_manager.as_ref().unwrap().commit();
|
state
|
||||||
|
.workspace_state
|
||||||
|
.workspace_manager()
|
||||||
|
.get()
|
||||||
|
.unwrap()
|
||||||
|
.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Event::Closed => {
|
Event::Closed => {
|
||||||
if let Some(workspace_manager) = &mut state.workspace_manager {
|
if let Ok(workspace_manager) =
|
||||||
for g in &mut state.workspace_groups {
|
state.workspace_state.workspace_manager().get()
|
||||||
g.workspace_group_handle.destroy();
|
{
|
||||||
|
for g in state.workspace_state.workspace_groups() {
|
||||||
|
g.handle.destroy();
|
||||||
}
|
}
|
||||||
workspace_manager.stop();
|
workspace_manager.stop();
|
||||||
}
|
}
|
||||||
|
|
@ -140,44 +161,52 @@ pub fn spawn_workspaces(tx: mpsc::Sender<WorkspaceList>) -> SyncSender<Workspace
|
||||||
workspaces_tx
|
workspaces_tx
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug)]
|
||||||
pub struct State {
|
pub struct State {
|
||||||
outputs_to_handle: Option<Vec<WlOutput>>,
|
|
||||||
wm_name: Option<(u32, WlRegistry)>,
|
|
||||||
running: bool,
|
running: bool,
|
||||||
tx: mpsc::Sender<WorkspaceList>,
|
tx: mpsc::Sender<WorkspaceList>,
|
||||||
configured_output: String,
|
configured_output: String,
|
||||||
expected_output: Option<WlOutput>,
|
expected_output: Option<WlOutput>,
|
||||||
workspace_manager: Option<ZcosmicWorkspaceManagerV1>,
|
output_state: OutputState,
|
||||||
workspace_groups: Vec<WorkspaceGroup>,
|
registry_state: RegistryState,
|
||||||
|
workspace_state: WorkspaceState,
|
||||||
|
have_workspaces: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl State {
|
impl State {
|
||||||
// XXX
|
|
||||||
pub fn workspace_list(
|
pub fn workspace_list(
|
||||||
&self,
|
&self,
|
||||||
) -> Vec<(String, Option<zcosmic_workspace_handle_v1::State>, ObjectId)> {
|
) -> Vec<(String, Option<zcosmic_workspace_handle_v1::State>, ObjectId)> {
|
||||||
self.workspace_groups
|
self.workspace_state
|
||||||
|
.workspace_groups()
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|g| {
|
.filter_map(|g| {
|
||||||
// TODO remove none check when workspace groups receive output event
|
if g.output == self.expected_output {
|
||||||
if g.output.is_none() || g.output == self.expected_output {
|
|
||||||
Some(g.workspaces.iter().map(|w| {
|
Some(g.workspaces.iter().map(|w| {
|
||||||
(
|
(
|
||||||
w.name.clone(),
|
w.name.clone(),
|
||||||
match &w.states {
|
match &w.state {
|
||||||
x if x.contains(&zcosmic_workspace_handle_v1::State::Active) => {
|
x if x.contains(&WEnum::Value(
|
||||||
|
zcosmic_workspace_handle_v1::State::Active,
|
||||||
|
)) =>
|
||||||
|
{
|
||||||
Some(zcosmic_workspace_handle_v1::State::Active)
|
Some(zcosmic_workspace_handle_v1::State::Active)
|
||||||
}
|
}
|
||||||
x if x.contains(&zcosmic_workspace_handle_v1::State::Urgent) => {
|
x if x.contains(&WEnum::Value(
|
||||||
|
zcosmic_workspace_handle_v1::State::Urgent,
|
||||||
|
)) =>
|
||||||
|
{
|
||||||
Some(zcosmic_workspace_handle_v1::State::Urgent)
|
Some(zcosmic_workspace_handle_v1::State::Urgent)
|
||||||
}
|
}
|
||||||
x if x.contains(&zcosmic_workspace_handle_v1::State::Hidden) => {
|
x if x.contains(&WEnum::Value(
|
||||||
|
zcosmic_workspace_handle_v1::State::Hidden,
|
||||||
|
)) =>
|
||||||
|
{
|
||||||
Some(zcosmic_workspace_handle_v1::State::Hidden)
|
Some(zcosmic_workspace_handle_v1::State::Hidden)
|
||||||
}
|
}
|
||||||
_ => None,
|
_ => None,
|
||||||
},
|
},
|
||||||
w.workspace_handle.id(),
|
w.handle.id(),
|
||||||
)
|
)
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -189,260 +218,61 @@ impl State {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
impl ProvidesRegistryState for State {
|
||||||
struct WorkspaceGroup {
|
fn registry(&mut self) -> &mut RegistryState {
|
||||||
workspace_group_handle: ZcosmicWorkspaceGroupHandleV1,
|
&mut self.registry_state
|
||||||
output: Option<WlOutput>,
|
}
|
||||||
workspaces: Vec<Workspace>,
|
sctk::registry_handlers![OutputState,];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
impl OutputHandler for State {
|
||||||
pub struct Workspace {
|
fn output_state(&mut self) -> &mut OutputState {
|
||||||
workspace_handle: ZcosmicWorkspaceHandleV1,
|
&mut self.output_state
|
||||||
name: String,
|
}
|
||||||
coordinates: Vec<u32>,
|
|
||||||
states: Vec<zcosmic_workspace_handle_v1::State>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<wl_registry::WlRegistry, ()> for State {
|
fn new_output(
|
||||||
fn event(
|
&mut self,
|
||||||
state: &mut Self,
|
_conn: &Connection,
|
||||||
registry: &wl_registry::WlRegistry,
|
_qh: &QueueHandle<Self>,
|
||||||
event: wl_registry::Event,
|
output: wl_output::WlOutput,
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
qh: &QueueHandle<Self>,
|
|
||||||
) {
|
) {
|
||||||
if let wl_registry::Event::Global {
|
let info = self.output_state.info(&output).unwrap();
|
||||||
name,
|
if info.name.as_deref() == Some(&self.configured_output) {
|
||||||
interface,
|
self.expected_output = Some(output);
|
||||||
version: _version,
|
if self.have_workspaces {
|
||||||
} = event
|
let _ = block_on(self.tx.send(self.workspace_list()));
|
||||||
{
|
|
||||||
match &interface[..] {
|
|
||||||
"zcosmic_workspace_manager_v1" => {
|
|
||||||
if let Some(outputs_to_handle) = state.outputs_to_handle.as_ref() {
|
|
||||||
if outputs_to_handle.is_empty() {
|
|
||||||
let workspace_manager =
|
|
||||||
registry.bind::<ZcosmicWorkspaceManagerV1, _, _>(name, 1, qh, ());
|
|
||||||
state.workspace_manager = Some(workspace_manager);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// will be handled when outputs are done...
|
|
||||||
state.wm_name.replace((name, registry.clone()));
|
|
||||||
}
|
|
||||||
"wl_output" => {
|
|
||||||
let _output = registry.bind::<WlOutput, _, _>(name, 4, qh, ());
|
|
||||||
match state.outputs_to_handle.as_mut() {
|
|
||||||
Some(outputs_to_handle) => outputs_to_handle.push(_output),
|
|
||||||
None => {
|
|
||||||
state.outputs_to_handle.replace(vec![_output]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZcosmicWorkspaceManagerV1, ()> for State {
|
fn update_output(
|
||||||
fn event(
|
&mut self,
|
||||||
state: &mut Self,
|
_conn: &Connection,
|
||||||
_: &ZcosmicWorkspaceManagerV1,
|
_qh: &QueueHandle<Self>,
|
||||||
event: zcosmic_workspace_manager_v1::Event,
|
_output: wl_output::WlOutput,
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
) {
|
||||||
match event {
|
|
||||||
zcosmic_workspace_manager_v1::Event::WorkspaceGroup { workspace_group } => {
|
|
||||||
state.workspace_groups.push(WorkspaceGroup {
|
|
||||||
workspace_group_handle: workspace_group,
|
|
||||||
output: None,
|
|
||||||
workspaces: Vec::new(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
zcosmic_workspace_manager_v1::Event::Done => {
|
|
||||||
for group in &mut state.workspace_groups {
|
|
||||||
group.workspaces.sort_by(|w1, w2| {
|
|
||||||
w1.coordinates
|
|
||||||
.iter()
|
|
||||||
.zip(w2.coordinates.iter())
|
|
||||||
.rev()
|
|
||||||
.skip_while(|(coord1, coord2)| coord1 == coord2)
|
|
||||||
.next()
|
|
||||||
.map(|(coord1, coord2)| coord1.cmp(coord2))
|
|
||||||
.unwrap_or(std::cmp::Ordering::Equal)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
let _ = block_on(state.tx.send(state.workspace_list()));
|
|
||||||
}
|
|
||||||
zcosmic_workspace_manager_v1::Event::Finished => {
|
|
||||||
state.workspace_manager.take();
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event_created_child!(State, ZcosmicWorkspaceManagerV1, [
|
fn output_destroyed(
|
||||||
0 => (ZcosmicWorkspaceGroupHandleV1, ())
|
&mut self,
|
||||||
]);
|
_conn: &Connection,
|
||||||
}
|
_qh: &QueueHandle<Self>,
|
||||||
|
_output: wl_output::WlOutput,
|
||||||
impl Dispatch<ZcosmicWorkspaceGroupHandleV1, ()> for State {
|
|
||||||
fn event(
|
|
||||||
state: &mut Self,
|
|
||||||
group: &ZcosmicWorkspaceGroupHandleV1,
|
|
||||||
event: zcosmic_workspace_group_handle_v1::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
) {
|
||||||
match event {
|
|
||||||
zcosmic_workspace_group_handle_v1::Event::OutputEnter { output } => {
|
|
||||||
if let Some(group) = state
|
|
||||||
.workspace_groups
|
|
||||||
.iter_mut()
|
|
||||||
.find(|g| &g.workspace_group_handle == group)
|
|
||||||
{
|
|
||||||
group.output = Some(output);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zcosmic_workspace_group_handle_v1::Event::OutputLeave { output } => {
|
|
||||||
if let Some(group) = state.workspace_groups.iter_mut().find(|g| {
|
|
||||||
&g.workspace_group_handle == group && g.output.as_ref() == Some(&output)
|
|
||||||
}) {
|
|
||||||
group.output = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zcosmic_workspace_group_handle_v1::Event::Workspace { workspace } => {
|
|
||||||
if let Some(group) = state
|
|
||||||
.workspace_groups
|
|
||||||
.iter_mut()
|
|
||||||
.find(|g| &g.workspace_group_handle == group)
|
|
||||||
{
|
|
||||||
group.workspaces.push(Workspace {
|
|
||||||
workspace_handle: workspace,
|
|
||||||
name: String::new(),
|
|
||||||
coordinates: Vec::new(),
|
|
||||||
states: Vec::new(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zcosmic_workspace_group_handle_v1::Event::Remove => {
|
|
||||||
if let Some(group) = state
|
|
||||||
.workspace_groups
|
|
||||||
.iter()
|
|
||||||
.position(|g| &g.workspace_group_handle == group)
|
|
||||||
{
|
|
||||||
state.workspace_groups.remove(group);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
event_created_child!(State, ZcosmicWorkspaceGroupHandleV1, [
|
|
||||||
3 => (ZcosmicWorkspaceHandleV1, ())
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Dispatch<ZcosmicWorkspaceHandleV1, ()> for State {
|
|
||||||
fn event(
|
|
||||||
state: &mut Self,
|
|
||||||
workspace: &ZcosmicWorkspaceHandleV1,
|
|
||||||
event: zcosmic_workspace_handle_v1::Event,
|
|
||||||
_: &(),
|
|
||||||
_: &Connection,
|
|
||||||
_: &QueueHandle<Self>,
|
|
||||||
) {
|
|
||||||
match event {
|
|
||||||
zcosmic_workspace_handle_v1::Event::Name { name } => {
|
|
||||||
if let Some(w) = state.workspace_groups.iter_mut().find_map(|g| {
|
|
||||||
g.workspaces
|
|
||||||
.iter_mut()
|
|
||||||
.find(|w| &w.workspace_handle == workspace)
|
|
||||||
}) {
|
|
||||||
w.name = name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zcosmic_workspace_handle_v1::Event::Coordinates { coordinates } => {
|
|
||||||
if let Some(w) = state.workspace_groups.iter_mut().find_map(|g| {
|
|
||||||
g.workspaces
|
|
||||||
.iter_mut()
|
|
||||||
.find(|w| &w.workspace_handle == workspace)
|
|
||||||
}) {
|
|
||||||
// wayland is host byte order
|
|
||||||
w.coordinates = coordinates
|
|
||||||
.chunks(4)
|
|
||||||
.map(|chunk| u32::from_ne_bytes(chunk.try_into().unwrap()))
|
|
||||||
.collect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zcosmic_workspace_handle_v1::Event::State {
|
|
||||||
state: workspace_state,
|
|
||||||
} => {
|
|
||||||
if let Some(w) = state.workspace_groups.iter_mut().find_map(|g| {
|
|
||||||
g.workspaces
|
|
||||||
.iter_mut()
|
|
||||||
.find(|w| &w.workspace_handle == workspace)
|
|
||||||
}) {
|
|
||||||
// wayland is host byte order
|
|
||||||
w.states = workspace_state
|
|
||||||
.chunks(4)
|
|
||||||
.map(|chunk| {
|
|
||||||
zcosmic_workspace_handle_v1::State::try_from(u32::from_ne_bytes(
|
|
||||||
chunk.try_into().unwrap(),
|
|
||||||
))
|
|
||||||
.unwrap()
|
|
||||||
})
|
|
||||||
.collect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
zcosmic_workspace_handle_v1::Event::Remove => {
|
|
||||||
if let Some((g, w_i)) = state.workspace_groups.iter_mut().find_map(|g| {
|
|
||||||
g.workspaces
|
|
||||||
.iter_mut()
|
|
||||||
.position(|w| &w.workspace_handle == workspace)
|
|
||||||
.map(|p| (g, p))
|
|
||||||
}) {
|
|
||||||
g.workspaces.remove(w_i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Dispatch<WlOutput, ()> for State {
|
impl WorkspaceHandler for State {
|
||||||
fn event(
|
fn workspace_state(&mut self) -> &mut WorkspaceState {
|
||||||
state: &mut Self,
|
&mut self.workspace_state
|
||||||
o: &WlOutput,
|
}
|
||||||
e: wl_output::Event,
|
|
||||||
_: &(),
|
fn done(&mut self) {
|
||||||
_: &Connection,
|
self.have_workspaces = true;
|
||||||
qh: &QueueHandle<Self>,
|
let _ = block_on(self.tx.send(self.workspace_list()));
|
||||||
) {
|
|
||||||
match e {
|
|
||||||
wl_output::Event::Name { name } if name == state.configured_output => {
|
|
||||||
state.expected_output.replace(o.clone());
|
|
||||||
// Necessary bc often the output is handled after the workspaces
|
|
||||||
let _ = block_on(state.tx.send(state.workspace_list()));
|
|
||||||
}
|
|
||||||
wl_output::Event::Done => {
|
|
||||||
let outputs_to_handle = state.outputs_to_handle.as_mut().unwrap();
|
|
||||||
outputs_to_handle.retain(|o_to_handle| o != o_to_handle);
|
|
||||||
if outputs_to_handle.is_empty() {
|
|
||||||
if let Some((wm_name, registry)) = state.wm_name.as_ref() {
|
|
||||||
let workspace_manager =
|
|
||||||
registry.bind::<ZcosmicWorkspaceManagerV1, _, _>(*wm_name, 1, qh, ());
|
|
||||||
state.workspace_manager = Some(workspace_manager);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_ => {} // ignored
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cosmic_client_toolkit::delegate_workspace!(State);
|
||||||
|
sctk::delegate_output!(State);
|
||||||
|
sctk::delegate_registry!(State);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue