Skip to content

Commit 3da2f6e

Browse files
authored
Update main.rs
1 parent 69a0dfc commit 3da2f6e

1 file changed

Lines changed: 31 additions & 12 deletions

File tree

src/main.rs

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
mod state;
22
mod input;
33
mod input_emulation;
4+
mod portal;
45
mod render;
56
mod ipc;
67
mod xwayland;
@@ -213,12 +214,21 @@ fn run_udev() {
213214
st.init_ipc(&loop_handle);
214215

215216
// EIS input-emulation socket — see input_emulation module doc for
216-
// scope (real EIS transport, no D-Bus portal service yet). Not
217-
// fatal if it fails (e.g. no writable XDG_RUNTIME_DIR in some
218-
// exotic sandbox) — the rest of the compositor works fine without
219-
// it, this is strictly additive.
220-
if let Err(e) = input_emulation::init(&mut st, &loop_handle) {
221-
warn!("EIS input-emulation socket failed to start (remote-input clients won't be able to connect): {e}");
217+
// scope. Not fatal if it fails (e.g. no writable XDG_RUNTIME_DIR in
218+
// some exotic sandbox) — the rest of the compositor works fine
219+
// without it, this is strictly additive.
220+
match input_emulation::init(&mut st, &loop_handle) {
221+
Ok(eis_path) => {
222+
// D-Bus portal backend — see portal/mod.rs's module doc for
223+
// exactly what this does and its one real, load-bearing
224+
// caveat (no consent UI). Only started once the EIS socket
225+
// itself actually exists, since ConnectToEIS has nothing to
226+
// bridge to otherwise.
227+
portal::init(eis_path);
228+
}
229+
Err(e) => {
230+
warn!("EIS input-emulation socket failed to start (remote-input clients won't be able to connect): {e}");
231+
}
222232
}
223233

224234
// Idle / DPMS timer
@@ -317,12 +327,21 @@ fn run_winit() {
317327
st.init_ipc(&loop_handle);
318328

319329
// EIS input-emulation socket — see input_emulation module doc for
320-
// scope (real EIS transport, no D-Bus portal service yet). Not
321-
// fatal if it fails (e.g. no writable XDG_RUNTIME_DIR in some
322-
// exotic sandbox) — the rest of the compositor works fine without
323-
// it, this is strictly additive.
324-
if let Err(e) = input_emulation::init(&mut st, &loop_handle) {
325-
warn!("EIS input-emulation socket failed to start (remote-input clients won't be able to connect): {e}");
330+
// scope. Not fatal if it fails (e.g. no writable XDG_RUNTIME_DIR in
331+
// some exotic sandbox) — the rest of the compositor works fine
332+
// without it, this is strictly additive.
333+
match input_emulation::init(&mut st, &loop_handle) {
334+
Ok(eis_path) => {
335+
// D-Bus portal backend — see portal/mod.rs's module doc for
336+
// exactly what this does and its one real, load-bearing
337+
// caveat (no consent UI). Only started once the EIS socket
338+
// itself actually exists, since ConnectToEIS has nothing to
339+
// bridge to otherwise.
340+
portal::init(eis_path);
341+
}
342+
Err(e) => {
343+
warn!("EIS input-emulation socket failed to start (remote-input clients won't be able to connect): {e}");
344+
}
326345
}
327346

328347
// Idle / DPMS timer

0 commit comments

Comments
 (0)