Add trivial Mutter ServiceChannel impl
Browse files at this commite09a6d6392e73d8410b177ed9307c15f97d14858Parent: a54e0486 changed files +657 -4
- Cargo.lock +596 -4
- Cargo.toml +1 -0
- src/dbus/mod.rs +1 -0
- src/dbus/mutter_service_channel.rs +38 -0
- src/main.rs +1 -0
- src/niri.rs +20 -0
Cargo.lockmodified+596 -4
| @@ -105,6 +105,134 @@ dependencies = [ | |||
| 105 | "num-traits", | 105 | "num-traits", |
| 106 | ] | 106 | ] |
| 107 | 107 | ||
| 108 | +[[package]] | ||
| 109 | +name = "async-broadcast" | ||
| 110 | +version = "0.5.1" | ||
| 111 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 112 | +checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" | ||
| 113 | +dependencies = [ | ||
| 114 | + "event-listener", | ||
| 115 | + "futures-core", | ||
| 116 | +] | ||
| 117 | + | ||
| 118 | +[[package]] | ||
| 119 | +name = "async-channel" | ||
| 120 | +version = "1.9.0" | ||
| 121 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 122 | +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" | ||
| 123 | +dependencies = [ | ||
| 124 | + "concurrent-queue", | ||
| 125 | + "event-listener", | ||
| 126 | + "futures-core", | ||
| 127 | +] | ||
| 128 | + | ||
| 129 | +[[package]] | ||
| 130 | +name = "async-executor" | ||
| 131 | +version = "1.5.1" | ||
| 132 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 133 | +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" | ||
| 134 | +dependencies = [ | ||
| 135 | + "async-lock", | ||
| 136 | + "async-task", | ||
| 137 | + "concurrent-queue", | ||
| 138 | + "fastrand 1.9.0", | ||
| 139 | + "futures-lite", | ||
| 140 | + "slab", | ||
| 141 | +] | ||
| 142 | + | ||
| 143 | +[[package]] | ||
| 144 | +name = "async-fs" | ||
| 145 | +version = "1.6.0" | ||
| 146 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 147 | +checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" | ||
| 148 | +dependencies = [ | ||
| 149 | + "async-lock", | ||
| 150 | + "autocfg", | ||
| 151 | + "blocking", | ||
| 152 | + "futures-lite", | ||
| 153 | +] | ||
| 154 | + | ||
| 155 | +[[package]] | ||
| 156 | +name = "async-io" | ||
| 157 | +version = "1.13.0" | ||
| 158 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 159 | +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" | ||
| 160 | +dependencies = [ | ||
| 161 | + "async-lock", | ||
| 162 | + "autocfg", | ||
| 163 | + "cfg-if", | ||
| 164 | + "concurrent-queue", | ||
| 165 | + "futures-lite", | ||
| 166 | + "log", | ||
| 167 | + "parking", | ||
| 168 | + "polling", | ||
| 169 | + "rustix 0.37.23", | ||
| 170 | + "slab", | ||
| 171 | + "socket2", | ||
| 172 | + "waker-fn", | ||
| 173 | +] | ||
| 174 | + | ||
| 175 | +[[package]] | ||
| 176 | +name = "async-lock" | ||
| 177 | +version = "2.8.0" | ||
| 178 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 179 | +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" | ||
| 180 | +dependencies = [ | ||
| 181 | + "event-listener", | ||
| 182 | +] | ||
| 183 | + | ||
| 184 | +[[package]] | ||
| 185 | +name = "async-process" | ||
| 186 | +version = "1.7.0" | ||
| 187 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 188 | +checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" | ||
| 189 | +dependencies = [ | ||
| 190 | + "async-io", | ||
| 191 | + "async-lock", | ||
| 192 | + "autocfg", | ||
| 193 | + "blocking", | ||
| 194 | + "cfg-if", | ||
| 195 | + "event-listener", | ||
| 196 | + "futures-lite", | ||
| 197 | + "rustix 0.37.23", | ||
| 198 | + "signal-hook", | ||
| 199 | + "windows-sys 0.48.0", | ||
| 200 | +] | ||
| 201 | + | ||
| 202 | +[[package]] | ||
| 203 | +name = "async-recursion" | ||
| 204 | +version = "1.0.4" | ||
| 205 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 206 | +checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" | ||
| 207 | +dependencies = [ | ||
| 208 | + "proc-macro2", | ||
| 209 | + "quote", | ||
| 210 | + "syn 2.0.28", | ||
| 211 | +] | ||
| 212 | + | ||
| 213 | +[[package]] | ||
| 214 | +name = "async-task" | ||
| 215 | +version = "4.4.0" | ||
| 216 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 217 | +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" | ||
| 218 | + | ||
| 219 | +[[package]] | ||
| 220 | +name = "async-trait" | ||
| 221 | +version = "0.1.73" | ||
| 222 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 223 | +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" | ||
| 224 | +dependencies = [ | ||
| 225 | + "proc-macro2", | ||
| 226 | + "quote", | ||
| 227 | + "syn 2.0.28", | ||
| 228 | +] | ||
| 229 | + | ||
| 230 | +[[package]] | ||
| 231 | +name = "atomic-waker" | ||
| 232 | +version = "1.1.1" | ||
| 233 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 234 | +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" | ||
| 235 | + | ||
| 108 | [[package]] | 236 | [[package]] |
| 109 | name = "autocfg" | 237 | name = "autocfg" |
| 110 | version = "1.1.0" | 238 | version = "1.1.0" |
| @@ -123,6 +251,15 @@ version = "2.4.0" | |||
| 123 | source = "registry+https://github.com/rust-lang/crates.io-index" | 251 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 124 | checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" | 252 | checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" |
| 125 | 253 | ||
| 254 | +[[package]] | ||
| 255 | +name = "block-buffer" | ||
| 256 | +version = "0.10.4" | ||
| 257 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 258 | +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" | ||
| 259 | +dependencies = [ | ||
| 260 | + "generic-array", | ||
| 261 | +] | ||
| 262 | + | ||
| 126 | [[package]] | 263 | [[package]] |
| 127 | name = "block-sys" | 264 | name = "block-sys" |
| 128 | version = "0.1.0-beta.1" | 265 | version = "0.1.0-beta.1" |
| @@ -142,6 +279,21 @@ dependencies = [ | |||
| 142 | "objc2-encode", | 279 | "objc2-encode", |
| 143 | ] | 280 | ] |
| 144 | 281 | ||
| 282 | +[[package]] | ||
| 283 | +name = "blocking" | ||
| 284 | +version = "1.3.1" | ||
| 285 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 286 | +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" | ||
| 287 | +dependencies = [ | ||
| 288 | + "async-channel", | ||
| 289 | + "async-lock", | ||
| 290 | + "async-task", | ||
| 291 | + "atomic-waker", | ||
| 292 | + "fastrand 1.9.0", | ||
| 293 | + "futures-lite", | ||
| 294 | + "log", | ||
| 295 | +] | ||
| 296 | + | ||
| 145 | [[package]] | 297 | [[package]] |
| 146 | name = "bumpalo" | 298 | name = "bumpalo" |
| 147 | version = "3.13.0" | 299 | version = "3.13.0" |
| @@ -168,6 +320,12 @@ dependencies = [ | |||
| 168 | "syn 2.0.28", | 320 | "syn 2.0.28", |
| 169 | ] | 321 | ] |
| 170 | 322 | ||
| 323 | +[[package]] | ||
| 324 | +name = "byteorder" | ||
| 325 | +version = "1.4.3" | ||
| 326 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 327 | +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" | ||
| 328 | + | ||
| 171 | [[package]] | 329 | [[package]] |
| 172 | name = "calloop" | 330 | name = "calloop" |
| 173 | version = "0.10.6" | 331 | version = "0.10.6" |
| @@ -261,6 +419,15 @@ version = "1.0.0" | |||
| 261 | source = "registry+https://github.com/rust-lang/crates.io-index" | 419 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 262 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" | 420 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" |
| 263 | 421 | ||
| 422 | +[[package]] | ||
| 423 | +name = "concurrent-queue" | ||
| 424 | +version = "2.2.0" | ||
| 425 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 426 | +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" | ||
| 427 | +dependencies = [ | ||
| 428 | + "crossbeam-utils", | ||
| 429 | +] | ||
| 430 | + | ||
| 264 | [[package]] | 431 | [[package]] |
| 265 | name = "core-foundation" | 432 | name = "core-foundation" |
| 266 | version = "0.9.3" | 433 | version = "0.9.3" |
| @@ -301,6 +468,55 @@ dependencies = [ | |||
| 301 | "libc", | 468 | "libc", |
| 302 | ] | 469 | ] |
| 303 | 470 | ||
| 471 | +[[package]] | ||
| 472 | +name = "cpufeatures" | ||
| 473 | +version = "0.2.9" | ||
| 474 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 475 | +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" | ||
| 476 | +dependencies = [ | ||
| 477 | + "libc", | ||
| 478 | +] | ||
| 479 | + | ||
| 480 | +[[package]] | ||
| 481 | +name = "crossbeam-utils" | ||
| 482 | +version = "0.8.16" | ||
| 483 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 484 | +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" | ||
| 485 | +dependencies = [ | ||
| 486 | + "cfg-if", | ||
| 487 | +] | ||
| 488 | + | ||
| 489 | +[[package]] | ||
| 490 | +name = "crypto-common" | ||
| 491 | +version = "0.1.6" | ||
| 492 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 493 | +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" | ||
| 494 | +dependencies = [ | ||
| 495 | + "generic-array", | ||
| 496 | + "typenum", | ||
| 497 | +] | ||
| 498 | + | ||
| 499 | +[[package]] | ||
| 500 | +name = "derivative" | ||
| 501 | +version = "2.2.0" | ||
| 502 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 503 | +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" | ||
| 504 | +dependencies = [ | ||
| 505 | + "proc-macro2", | ||
| 506 | + "quote", | ||
| 507 | + "syn 1.0.109", | ||
| 508 | +] | ||
| 509 | + | ||
| 510 | +[[package]] | ||
| 511 | +name = "digest" | ||
| 512 | +version = "0.10.7" | ||
| 513 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 514 | +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" | ||
| 515 | +dependencies = [ | ||
| 516 | + "block-buffer", | ||
| 517 | + "crypto-common", | ||
| 518 | +] | ||
| 519 | + | ||
| 304 | [[package]] | 520 | [[package]] |
| 305 | name = "dispatch" | 521 | name = "dispatch" |
| 306 | version = "0.2.0" | 522 | version = "0.2.0" |
| @@ -366,6 +582,27 @@ version = "0.1.0" | |||
| 366 | source = "registry+https://github.com/rust-lang/crates.io-index" | 582 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 367 | checksum = "2ab5fa33485cd85ac354df485819a63360fefa312fe04cffe65e6f175be1522c" | 583 | checksum = "2ab5fa33485cd85ac354df485819a63360fefa312fe04cffe65e6f175be1522c" |
| 368 | 584 | ||
| 585 | +[[package]] | ||
| 586 | +name = "enumflags2" | ||
| 587 | +version = "0.7.7" | ||
| 588 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 589 | +checksum = "c041f5090df68b32bcd905365fd51769c8b9d553fe87fde0b683534f10c01bd2" | ||
| 590 | +dependencies = [ | ||
| 591 | + "enumflags2_derive", | ||
| 592 | + "serde", | ||
| 593 | +] | ||
| 594 | + | ||
| 595 | +[[package]] | ||
| 596 | +name = "enumflags2_derive" | ||
| 597 | +version = "0.7.7" | ||
| 598 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 599 | +checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" | ||
| 600 | +dependencies = [ | ||
| 601 | + "proc-macro2", | ||
| 602 | + "quote", | ||
| 603 | + "syn 2.0.28", | ||
| 604 | +] | ||
| 605 | + | ||
| 369 | [[package]] | 606 | [[package]] |
| 370 | name = "equivalent" | 607 | name = "equivalent" |
| 371 | version = "1.0.1" | 608 | version = "1.0.1" |
| @@ -404,6 +641,21 @@ dependencies = [ | |||
| 404 | "libc", | 641 | "libc", |
| 405 | ] | 642 | ] |
| 406 | 643 | ||
| 644 | +[[package]] | ||
| 645 | +name = "event-listener" | ||
| 646 | +version = "2.5.3" | ||
| 647 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 648 | +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" | ||
| 649 | + | ||
| 650 | +[[package]] | ||
| 651 | +name = "fastrand" | ||
| 652 | +version = "1.9.0" | ||
| 653 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 654 | +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" | ||
| 655 | +dependencies = [ | ||
| 656 | + "instant", | ||
| 657 | +] | ||
| 658 | + | ||
| 407 | [[package]] | 659 | [[package]] |
| 408 | name = "fastrand" | 660 | name = "fastrand" |
| 409 | version = "2.0.0" | 661 | version = "2.0.0" |
| @@ -425,6 +677,61 @@ version = "0.1.1" | |||
| 425 | source = "registry+https://github.com/rust-lang/crates.io-index" | 677 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 426 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" | 678 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" |
| 427 | 679 | ||
| 680 | +[[package]] | ||
| 681 | +name = "futures-core" | ||
| 682 | +version = "0.3.28" | ||
| 683 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 684 | +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" | ||
| 685 | + | ||
| 686 | +[[package]] | ||
| 687 | +name = "futures-io" | ||
| 688 | +version = "0.3.28" | ||
| 689 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 690 | +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" | ||
| 691 | + | ||
| 692 | +[[package]] | ||
| 693 | +name = "futures-lite" | ||
| 694 | +version = "1.13.0" | ||
| 695 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 696 | +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" | ||
| 697 | +dependencies = [ | ||
| 698 | + "fastrand 1.9.0", | ||
| 699 | + "futures-core", | ||
| 700 | + "futures-io", | ||
| 701 | + "memchr", | ||
| 702 | + "parking", | ||
| 703 | + "pin-project-lite", | ||
| 704 | + "waker-fn", | ||
| 705 | +] | ||
| 706 | + | ||
| 707 | +[[package]] | ||
| 708 | +name = "futures-sink" | ||
| 709 | +version = "0.3.28" | ||
| 710 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 711 | +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" | ||
| 712 | + | ||
| 713 | +[[package]] | ||
| 714 | +name = "futures-task" | ||
| 715 | +version = "0.3.28" | ||
| 716 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 717 | +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" | ||
| 718 | + | ||
| 719 | +[[package]] | ||
| 720 | +name = "futures-util" | ||
| 721 | +version = "0.3.28" | ||
| 722 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 723 | +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" | ||
| 724 | +dependencies = [ | ||
| 725 | + "futures-core", | ||
| 726 | + "futures-io", | ||
| 727 | + "futures-sink", | ||
| 728 | + "futures-task", | ||
| 729 | + "memchr", | ||
| 730 | + "pin-project-lite", | ||
| 731 | + "pin-utils", | ||
| 732 | + "slab", | ||
| 733 | +] | ||
| 734 | + | ||
| 428 | [[package]] | 735 | [[package]] |
| 429 | name = "gbm" | 736 | name = "gbm" |
| 430 | version = "0.12.0" | 737 | version = "0.12.0" |
| @@ -462,6 +769,16 @@ dependencies = [ | |||
| 462 | "windows", | 769 | "windows", |
| 463 | ] | 770 | ] |
| 464 | 771 | ||
| 772 | +[[package]] | ||
| 773 | +name = "generic-array" | ||
| 774 | +version = "0.14.7" | ||
| 775 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 776 | +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" | ||
| 777 | +dependencies = [ | ||
| 778 | + "typenum", | ||
| 779 | + "version_check", | ||
| 780 | +] | ||
| 781 | + | ||
| 465 | [[package]] | 782 | [[package]] |
| 466 | name = "getrandom" | 783 | name = "getrandom" |
| 467 | version = "0.2.10" | 784 | version = "0.2.10" |
| @@ -508,6 +825,12 @@ version = "0.3.2" | |||
| 508 | source = "registry+https://github.com/rust-lang/crates.io-index" | 825 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 509 | checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" | 826 | checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" |
| 510 | 827 | ||
| 828 | +[[package]] | ||
| 829 | +name = "hex" | ||
| 830 | +version = "0.4.3" | ||
| 831 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 832 | +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" | ||
| 833 | + | ||
| 511 | [[package]] | 834 | [[package]] |
| 512 | name = "indexmap" | 835 | name = "indexmap" |
| 513 | version = "1.9.3" | 836 | version = "1.9.3" |
| @@ -580,7 +903,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 580 | checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" | 903 | checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" |
| 581 | dependencies = [ | 904 | dependencies = [ |
| 582 | "hermit-abi", | 905 | "hermit-abi", |
| 583 | - "rustix", | 906 | + "rustix 0.38.8", |
| 584 | "windows-sys 0.48.0", | 907 | "windows-sys 0.48.0", |
| 585 | ] | 908 | ] |
| 586 | 909 | ||
| @@ -681,6 +1004,12 @@ dependencies = [ | |||
| 681 | "pkg-config", | 1004 | "pkg-config", |
| 682 | ] | 1005 | ] |
| 683 | 1006 | ||
| 1007 | +[[package]] | ||
| 1008 | +name = "linux-raw-sys" | ||
| 1009 | +version = "0.3.8" | ||
| 1010 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1011 | +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" | ||
| 1012 | + | ||
| 684 | [[package]] | 1013 | [[package]] |
| 685 | name = "linux-raw-sys" | 1014 | name = "linux-raw-sys" |
| 686 | version = "0.4.5" | 1015 | version = "0.4.5" |
| @@ -820,6 +1149,7 @@ dependencies = [ | |||
| 820 | "tracing-subscriber", | 1149 | "tracing-subscriber", |
| 821 | "tracy-client", | 1150 | "tracy-client", |
| 822 | "xcursor", | 1151 | "xcursor", |
| 1152 | + "zbus", | ||
| 823 | ] | 1153 | ] |
| 824 | 1154 | ||
| 825 | [[package]] | 1155 | [[package]] |
| @@ -974,12 +1304,28 @@ dependencies = [ | |||
| 974 | "redox_syscall", | 1304 | "redox_syscall", |
| 975 | ] | 1305 | ] |
| 976 | 1306 | ||
| 1307 | +[[package]] | ||
| 1308 | +name = "ordered-stream" | ||
| 1309 | +version = "0.2.0" | ||
| 1310 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1311 | +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" | ||
| 1312 | +dependencies = [ | ||
| 1313 | + "futures-core", | ||
| 1314 | + "pin-project-lite", | ||
| 1315 | +] | ||
| 1316 | + | ||
| 977 | [[package]] | 1317 | [[package]] |
| 978 | name = "overload" | 1318 | name = "overload" |
| 979 | version = "0.1.1" | 1319 | version = "0.1.1" |
| 980 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1320 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 981 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" | 1321 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" |
| 982 | 1322 | ||
| 1323 | +[[package]] | ||
| 1324 | +name = "parking" | ||
| 1325 | +version = "2.1.0" | ||
| 1326 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1327 | +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" | ||
| 1328 | + | ||
| 983 | [[package]] | 1329 | [[package]] |
| 984 | name = "percent-encoding" | 1330 | name = "percent-encoding" |
| 985 | version = "2.3.0" | 1331 | version = "2.3.0" |
| @@ -1004,6 +1350,22 @@ version = "0.3.27" | |||
| 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1350 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1005 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" | 1351 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" |
| 1006 | 1352 | ||
| 1353 | +[[package]] | ||
| 1354 | +name = "polling" | ||
| 1355 | +version = "2.8.0" | ||
| 1356 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1357 | +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" | ||
| 1358 | +dependencies = [ | ||
| 1359 | + "autocfg", | ||
| 1360 | + "bitflags 1.3.2", | ||
| 1361 | + "cfg-if", | ||
| 1362 | + "concurrent-queue", | ||
| 1363 | + "libc", | ||
| 1364 | + "log", | ||
| 1365 | + "pin-project-lite", | ||
| 1366 | + "windows-sys 0.48.0", | ||
| 1367 | +] | ||
| 1368 | + | ||
| 1007 | [[package]] | 1369 | [[package]] |
| 1008 | name = "ppv-lite86" | 1370 | name = "ppv-lite86" |
| 1009 | version = "0.2.17" | 1371 | version = "0.2.17" |
| @@ -1156,6 +1518,20 @@ version = "0.7.4" | |||
| 1156 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1518 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1157 | checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" | 1519 | checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" |
| 1158 | 1520 | ||
| 1521 | +[[package]] | ||
| 1522 | +name = "rustix" | ||
| 1523 | +version = "0.37.23" | ||
| 1524 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1525 | +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" | ||
| 1526 | +dependencies = [ | ||
| 1527 | + "bitflags 1.3.2", | ||
| 1528 | + "errno 0.3.2", | ||
| 1529 | + "io-lifetimes", | ||
| 1530 | + "libc", | ||
| 1531 | + "linux-raw-sys 0.3.8", | ||
| 1532 | + "windows-sys 0.48.0", | ||
| 1533 | +] | ||
| 1534 | + | ||
| 1159 | [[package]] | 1535 | [[package]] |
| 1160 | name = "rustix" | 1536 | name = "rustix" |
| 1161 | version = "0.38.8" | 1537 | version = "0.38.8" |
| @@ -1165,7 +1541,7 @@ dependencies = [ | |||
| 1165 | "bitflags 2.4.0", | 1541 | "bitflags 2.4.0", |
| 1166 | "errno 0.3.2", | 1542 | "errno 0.3.2", |
| 1167 | "libc", | 1543 | "libc", |
| 1168 | - "linux-raw-sys", | 1544 | + "linux-raw-sys 0.4.5", |
| 1169 | "windows-sys 0.48.0", | 1545 | "windows-sys 0.48.0", |
| 1170 | ] | 1546 | ] |
| 1171 | 1547 | ||
| @@ -1193,6 +1569,48 @@ version = "0.4.1" | |||
| 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1569 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1194 | checksum = "621e3680f3e07db4c9c2c3fb07c6223ab2fab2e54bd3c04c3ae037990f428c32" | 1570 | checksum = "621e3680f3e07db4c9c2c3fb07c6223ab2fab2e54bd3c04c3ae037990f428c32" |
| 1195 | 1571 | ||
| 1572 | +[[package]] | ||
| 1573 | +name = "serde" | ||
| 1574 | +version = "1.0.188" | ||
| 1575 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1576 | +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" | ||
| 1577 | +dependencies = [ | ||
| 1578 | + "serde_derive", | ||
| 1579 | +] | ||
| 1580 | + | ||
| 1581 | +[[package]] | ||
| 1582 | +name = "serde_derive" | ||
| 1583 | +version = "1.0.188" | ||
| 1584 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1585 | +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" | ||
| 1586 | +dependencies = [ | ||
| 1587 | + "proc-macro2", | ||
| 1588 | + "quote", | ||
| 1589 | + "syn 2.0.28", | ||
| 1590 | +] | ||
| 1591 | + | ||
| 1592 | +[[package]] | ||
| 1593 | +name = "serde_repr" | ||
| 1594 | +version = "0.1.16" | ||
| 1595 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1596 | +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" | ||
| 1597 | +dependencies = [ | ||
| 1598 | + "proc-macro2", | ||
| 1599 | + "quote", | ||
| 1600 | + "syn 2.0.28", | ||
| 1601 | +] | ||
| 1602 | + | ||
| 1603 | +[[package]] | ||
| 1604 | +name = "sha1" | ||
| 1605 | +version = "0.10.5" | ||
| 1606 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1607 | +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" | ||
| 1608 | +dependencies = [ | ||
| 1609 | + "cfg-if", | ||
| 1610 | + "cpufeatures", | ||
| 1611 | + "digest", | ||
| 1612 | +] | ||
| 1613 | + | ||
| 1196 | [[package]] | 1614 | [[package]] |
| 1197 | name = "sharded-slab" | 1615 | name = "sharded-slab" |
| 1198 | version = "0.1.4" | 1616 | version = "0.1.4" |
| @@ -1202,6 +1620,34 @@ dependencies = [ | |||
| 1202 | "lazy_static", | 1620 | "lazy_static", |
| 1203 | ] | 1621 | ] |
| 1204 | 1622 | ||
| 1623 | +[[package]] | ||
| 1624 | +name = "signal-hook" | ||
| 1625 | +version = "0.3.17" | ||
| 1626 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1627 | +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" | ||
| 1628 | +dependencies = [ | ||
| 1629 | + "libc", | ||
| 1630 | + "signal-hook-registry", | ||
| 1631 | +] | ||
| 1632 | + | ||
| 1633 | +[[package]] | ||
| 1634 | +name = "signal-hook-registry" | ||
| 1635 | +version = "1.4.1" | ||
| 1636 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1637 | +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" | ||
| 1638 | +dependencies = [ | ||
| 1639 | + "libc", | ||
| 1640 | +] | ||
| 1641 | + | ||
| 1642 | +[[package]] | ||
| 1643 | +name = "slab" | ||
| 1644 | +version = "0.4.9" | ||
| 1645 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1646 | +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" | ||
| 1647 | +dependencies = [ | ||
| 1648 | + "autocfg", | ||
| 1649 | +] | ||
| 1650 | + | ||
| 1205 | [[package]] | 1651 | [[package]] |
| 1206 | name = "slog" | 1652 | name = "slog" |
| 1207 | version = "2.7.0" | 1653 | version = "2.7.0" |
| @@ -1293,6 +1739,16 @@ dependencies = [ | |||
| 1293 | "edid-rs", | 1739 | "edid-rs", |
| 1294 | ] | 1740 | ] |
| 1295 | 1741 | ||
| 1742 | +[[package]] | ||
| 1743 | +name = "socket2" | ||
| 1744 | +version = "0.4.9" | ||
| 1745 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1746 | +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" | ||
| 1747 | +dependencies = [ | ||
| 1748 | + "libc", | ||
| 1749 | + "winapi", | ||
| 1750 | +] | ||
| 1751 | + | ||
| 1296 | [[package]] | 1752 | [[package]] |
| 1297 | name = "static_assertions" | 1753 | name = "static_assertions" |
| 1298 | version = "1.1.0" | 1754 | version = "1.1.0" |
| @@ -1334,9 +1790,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
| 1334 | checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" | 1790 | checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" |
| 1335 | dependencies = [ | 1791 | dependencies = [ |
| 1336 | "cfg-if", | 1792 | "cfg-if", |
| 1337 | - "fastrand", | 1793 | + "fastrand 2.0.0", |
| 1338 | "redox_syscall", | 1794 | "redox_syscall", |
| 1339 | - "rustix", | 1795 | + "rustix 0.38.8", |
| 1340 | "windows-sys 0.48.0", | 1796 | "windows-sys 0.48.0", |
| 1341 | ] | 1797 | ] |
| 1342 | 1798 | ||
| @@ -1469,6 +1925,12 @@ dependencies = [ | |||
| 1469 | "cc", | 1925 | "cc", |
| 1470 | ] | 1926 | ] |
| 1471 | 1927 | ||
| 1928 | +[[package]] | ||
| 1929 | +name = "typenum" | ||
| 1930 | +version = "1.16.0" | ||
| 1931 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1932 | +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" | ||
| 1933 | + | ||
| 1472 | [[package]] | 1934 | [[package]] |
| 1473 | name = "udev" | 1935 | name = "udev" |
| 1474 | version = "0.7.0" | 1936 | version = "0.7.0" |
| @@ -1480,6 +1942,16 @@ dependencies = [ | |||
| 1480 | "pkg-config", | 1942 | "pkg-config", |
| 1481 | ] | 1943 | ] |
| 1482 | 1944 | ||
| 1945 | +[[package]] | ||
| 1946 | +name = "uds_windows" | ||
| 1947 | +version = "1.0.2" | ||
| 1948 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1949 | +checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" | ||
| 1950 | +dependencies = [ | ||
| 1951 | + "tempfile", | ||
| 1952 | + "winapi", | ||
| 1953 | +] | ||
| 1954 | + | ||
| 1483 | [[package]] | 1955 | [[package]] |
| 1484 | name = "unicode-ident" | 1956 | name = "unicode-ident" |
| 1485 | version = "1.0.11" | 1957 | version = "1.0.11" |
| @@ -1510,6 +1982,12 @@ version = "0.9.4" | |||
| 1510 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1982 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1511 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" | 1983 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" |
| 1512 | 1984 | ||
| 1985 | +[[package]] | ||
| 1986 | +name = "waker-fn" | ||
| 1987 | +version = "1.1.0" | ||
| 1988 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 1989 | +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" | ||
| 1990 | + | ||
| 1513 | [[package]] | 1991 | [[package]] |
| 1514 | name = "wasi" | 1992 | name = "wasi" |
| 1515 | version = "0.11.0+wasi-snapshot-preview1" | 1993 | version = "0.11.0+wasi-snapshot-preview1" |
| @@ -1980,6 +2458,16 @@ dependencies = [ | |||
| 1980 | "nom", | 2458 | "nom", |
| 1981 | ] | 2459 | ] |
| 1982 | 2460 | ||
| 2461 | +[[package]] | ||
| 2462 | +name = "xdg-home" | ||
| 2463 | +version = "1.0.0" | ||
| 2464 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2465 | +checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" | ||
| 2466 | +dependencies = [ | ||
| 2467 | + "nix 0.26.2", | ||
| 2468 | + "winapi", | ||
| 2469 | +] | ||
| 2470 | + | ||
| 1983 | [[package]] | 2471 | [[package]] |
| 1984 | name = "xkbcommon" | 2472 | name = "xkbcommon" |
| 1985 | version = "0.5.1" | 2473 | version = "0.5.1" |
| @@ -1995,3 +2483,107 @@ name = "xml-rs" | |||
| 1995 | version = "0.8.16" | 2483 | version = "0.8.16" |
| 1996 | source = "registry+https://github.com/rust-lang/crates.io-index" | 2484 | source = "registry+https://github.com/rust-lang/crates.io-index" |
| 1997 | checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" | 2485 | checksum = "47430998a7b5d499ccee752b41567bc3afc57e1327dc855b1a2aa44ce29b5fa1" |
| 2486 | + | ||
| 2487 | +[[package]] | ||
| 2488 | +name = "zbus" | ||
| 2489 | +version = "3.14.1" | ||
| 2490 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2491 | +checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" | ||
| 2492 | +dependencies = [ | ||
| 2493 | + "async-broadcast", | ||
| 2494 | + "async-executor", | ||
| 2495 | + "async-fs", | ||
| 2496 | + "async-io", | ||
| 2497 | + "async-lock", | ||
| 2498 | + "async-process", | ||
| 2499 | + "async-recursion", | ||
| 2500 | + "async-task", | ||
| 2501 | + "async-trait", | ||
| 2502 | + "blocking", | ||
| 2503 | + "byteorder", | ||
| 2504 | + "derivative", | ||
| 2505 | + "enumflags2", | ||
| 2506 | + "event-listener", | ||
| 2507 | + "futures-core", | ||
| 2508 | + "futures-sink", | ||
| 2509 | + "futures-util", | ||
| 2510 | + "hex", | ||
| 2511 | + "nix 0.26.2", | ||
| 2512 | + "once_cell", | ||
| 2513 | + "ordered-stream", | ||
| 2514 | + "rand", | ||
| 2515 | + "serde", | ||
| 2516 | + "serde_repr", | ||
| 2517 | + "sha1", | ||
| 2518 | + "static_assertions", | ||
| 2519 | + "tracing", | ||
| 2520 | + "uds_windows", | ||
| 2521 | + "winapi", | ||
| 2522 | + "xdg-home", | ||
| 2523 | + "zbus_macros", | ||
| 2524 | + "zbus_names", | ||
| 2525 | + "zvariant", | ||
| 2526 | +] | ||
| 2527 | + | ||
| 2528 | +[[package]] | ||
| 2529 | +name = "zbus_macros" | ||
| 2530 | +version = "3.14.1" | ||
| 2531 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2532 | +checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" | ||
| 2533 | +dependencies = [ | ||
| 2534 | + "proc-macro-crate", | ||
| 2535 | + "proc-macro2", | ||
| 2536 | + "quote", | ||
| 2537 | + "regex", | ||
| 2538 | + "syn 1.0.109", | ||
| 2539 | + "zvariant_utils", | ||
| 2540 | +] | ||
| 2541 | + | ||
| 2542 | +[[package]] | ||
| 2543 | +name = "zbus_names" | ||
| 2544 | +version = "2.6.0" | ||
| 2545 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2546 | +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" | ||
| 2547 | +dependencies = [ | ||
| 2548 | + "serde", | ||
| 2549 | + "static_assertions", | ||
| 2550 | + "zvariant", | ||
| 2551 | +] | ||
| 2552 | + | ||
| 2553 | +[[package]] | ||
| 2554 | +name = "zvariant" | ||
| 2555 | +version = "3.15.0" | ||
| 2556 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2557 | +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" | ||
| 2558 | +dependencies = [ | ||
| 2559 | + "byteorder", | ||
| 2560 | + "enumflags2", | ||
| 2561 | + "libc", | ||
| 2562 | + "serde", | ||
| 2563 | + "static_assertions", | ||
| 2564 | + "zvariant_derive", | ||
| 2565 | +] | ||
| 2566 | + | ||
| 2567 | +[[package]] | ||
| 2568 | +name = "zvariant_derive" | ||
| 2569 | +version = "3.15.0" | ||
| 2570 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2571 | +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" | ||
| 2572 | +dependencies = [ | ||
| 2573 | + "proc-macro-crate", | ||
| 2574 | + "proc-macro2", | ||
| 2575 | + "quote", | ||
| 2576 | + "syn 1.0.109", | ||
| 2577 | + "zvariant_utils", | ||
| 2578 | +] | ||
| 2579 | + | ||
| 2580 | +[[package]] | ||
| 2581 | +name = "zvariant_utils" | ||
| 2582 | +version = "1.0.1" | ||
| 2583 | +source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| 2584 | +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" | ||
| 2585 | +dependencies = [ | ||
| 2586 | + "proc-macro2", | ||
| 2587 | + "quote", | ||
| 2588 | + "syn 1.0.109", | ||
| 2589 | +] | ||
Cargo.tomlmodified+1 -0
| @@ -18,6 +18,7 @@ tracing = "0.1.37" | |||
| 18 | tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } | 18 | tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } |
| 19 | tracy-client = { version = "0.15.2", default-features = false } | 19 | tracy-client = { version = "0.15.2", default-features = false } |
| 20 | xcursor = "0.3.4" | 20 | xcursor = "0.3.4" |
| 21 | +zbus = { version = "3.14.1" } | ||
| 21 | 22 | ||
| 22 | [dependencies.smithay] | 23 | [dependencies.smithay] |
| 23 | git = "https://github.com/Smithay/smithay" | 24 | git = "https://github.com/Smithay/smithay" |
src/dbus/mod.rsadded+1 -0
| @@ -0,0 +1 @@ | |||
| 1 | +pub mod mutter_service_channel; | ||
src/dbus/mutter_service_channel.rsadded+38 -0
| @@ -0,0 +1,38 @@ | |||
| 1 | +use std::os::fd::{FromRawFd, IntoRawFd}; | ||
| 2 | +use std::os::unix::net::UnixStream; | ||
| 3 | +use std::sync::Arc; | ||
| 4 | + | ||
| 5 | +use smithay::reexports::wayland_server::DisplayHandle; | ||
| 6 | +use zbus::dbus_interface; | ||
| 7 | + | ||
| 8 | +use crate::niri::ClientState; | ||
| 9 | + | ||
| 10 | +pub struct ServiceChannel { | ||
| 11 | + display: DisplayHandle, | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +#[dbus_interface(name = "org.gnome.Mutter.ServiceChannel")] | ||
| 15 | +impl ServiceChannel { | ||
| 16 | + async fn open_wayland_service_connection( | ||
| 17 | + &mut self, | ||
| 18 | + service_client_type: u32, | ||
| 19 | + ) -> zbus::fdo::Result<zbus::zvariant::OwnedFd> { | ||
| 20 | + if service_client_type != 1 { | ||
| 21 | + return Err(zbus::fdo::Error::InvalidArgs( | ||
| 22 | + "Invalid service client type".to_owned(), | ||
| 23 | + )); | ||
| 24 | + } | ||
| 25 | + | ||
| 26 | + let (sock1, sock2) = UnixStream::pair().unwrap(); | ||
| 27 | + self.display | ||
| 28 | + .insert_client(sock2, Arc::new(ClientState::default())) | ||
| 29 | + .unwrap(); | ||
| 30 | + Ok(unsafe { zbus::zvariant::OwnedFd::from_raw_fd(sock1.into_raw_fd()) }) | ||
| 31 | + } | ||
| 32 | +} | ||
| 33 | + | ||
| 34 | +impl ServiceChannel { | ||
| 35 | + pub fn new(display: DisplayHandle) -> Self { | ||
| 36 | + Self { display } | ||
| 37 | + } | ||
| 38 | +} | ||
src/main.rsmodified+1 -0
| @@ -5,6 +5,7 @@ mod handlers; | |||
| 5 | 5 | ||
| 6 | mod animation; | 6 | mod animation; |
| 7 | mod backend; | 7 | mod backend; |
| 8 | +mod dbus; | ||
| 8 | mod frame_clock; | 9 | mod frame_clock; |
| 9 | mod input; | 10 | mod input; |
| 10 | mod layout; | 11 | mod layout; |
src/niri.rsmodified+20 -0
| @@ -44,6 +44,7 @@ use smithay::wayland::socket::ListeningSocketSource; | |||
| 44 | use smithay::wayland::tablet_manager::TabletManagerState; | 44 | use smithay::wayland::tablet_manager::TabletManagerState; |
| 45 | 45 | ||
| 46 | use crate::backend::Backend; | 46 | use crate::backend::Backend; |
| 47 | +use crate::dbus::mutter_service_channel::ServiceChannel; | ||
| 47 | use crate::frame_clock::FrameClock; | 48 | use crate::frame_clock::FrameClock; |
| 48 | use crate::layout::{MonitorRenderElement, MonitorSet}; | 49 | use crate::layout::{MonitorRenderElement, MonitorSet}; |
| 49 | use crate::utils::{center, get_monotonic_time, load_default_cursor}; | 50 | use crate::utils::{center, get_monotonic_time, load_default_cursor}; |
| @@ -85,6 +86,8 @@ pub struct Niri { | |||
| 85 | pub pointer_buffer: Option<(TextureBuffer<GlesTexture>, Point<i32, Physical>)>, | 86 | pub pointer_buffer: Option<(TextureBuffer<GlesTexture>, Point<i32, Physical>)>, |
| 86 | pub cursor_image: CursorImageStatus, | 87 | pub cursor_image: CursorImageStatus, |
| 87 | pub dnd_icon: Option<WlSurface>, | 88 | pub dnd_icon: Option<WlSurface>, |
| 89 | + | ||
| 90 | + pub zbus_conn: Option<zbus::blocking::Connection>, | ||
| 88 | } | 91 | } |
| 89 | 92 | ||
| 90 | pub struct OutputState { | 93 | pub struct OutputState { |
| @@ -151,6 +154,7 @@ impl Niri { | |||
| 151 | socket_name.to_string_lossy() | 154 | socket_name.to_string_lossy() |
| 152 | ); | 155 | ); |
| 153 | 156 | ||
| 157 | + let mut zbus_conn = None; | ||
| 154 | if std::env::var_os("NOTIFY_SOCKET").is_some() { | 158 | if std::env::var_os("NOTIFY_SOCKET").is_some() { |
| 155 | // We're starting as a systemd service. Export our variables and tell systemd we're | 159 | // We're starting as a systemd service. Export our variables and tell systemd we're |
| 156 | // ready. | 160 | // ready. |
| @@ -166,6 +170,20 @@ impl Niri { | |||
| 166 | warn!("error spawning shell to import environment into systemd: {err:?}"); | 170 | warn!("error spawning shell to import environment into systemd: {err:?}"); |
| 167 | } | 171 | } |
| 168 | 172 | ||
| 173 | + // Set up zbus, make sure it happens before anything might want it. | ||
| 174 | + let conn = zbus::blocking::ConnectionBuilder::session() | ||
| 175 | + .unwrap() | ||
| 176 | + .name("org.gnome.Mutter.ServiceChannel") | ||
| 177 | + .unwrap() | ||
| 178 | + .serve_at( | ||
| 179 | + "/org/gnome/Mutter/ServiceChannel", | ||
| 180 | + ServiceChannel::new(display_handle.clone()), | ||
| 181 | + ) | ||
| 182 | + .unwrap() | ||
| 183 | + .build() | ||
| 184 | + .unwrap(); | ||
| 185 | + zbus_conn = Some(conn); | ||
| 186 | + | ||
| 169 | // Notify systemd we're ready. | 187 | // Notify systemd we're ready. |
| 170 | if let Err(err) = sd_notify::notify(false, &[NotifyState::Ready]) { | 188 | if let Err(err) = sd_notify::notify(false, &[NotifyState::Ready]) { |
| 171 | warn!("error notifying systemd: {err:?}"); | 189 | warn!("error notifying systemd: {err:?}"); |
| @@ -210,6 +228,8 @@ impl Niri { | |||
| 210 | pointer_buffer: None, | 228 | pointer_buffer: None, |
| 211 | cursor_image: CursorImageStatus::Default, | 229 | cursor_image: CursorImageStatus::Default, |
| 212 | dnd_icon: None, | 230 | dnd_icon: None, |
| 231 | + | ||
| 232 | + zbus_conn, | ||
| 213 | } | 233 | } |
| 214 | } | 234 | } |
| 215 | 235 | ||