Commit 3e53341
committed
Delay connecting with gui-daemon until after starting Xorg
Until now, Xorg was started only after connecting with gui-daemon and
receiving xconf message. This was mostly because initial
resolution/video mem specified in the xorg.conf couldn't later be
changed and that affects maximum working resolution.
Since 49420c5 "Increase screen pixmap size beyond initial video RAM if
needed", this is no longer a problem. The only parameter (still) needed
before starting Xorg is GUI domain id, but this is available on the
command line. Change gui-agent to start Xorg earlier and only then wait
for gui-daemon. This allows starting all of the user session earlier,
optimizing startup time. This is especially relevant for VMs started on
boot (before user logs in), when GUI daemon isn't started yet. And also
helpful for preloaded disposables, which may start user session as part
of preloading now.
The current implementation is rather naive: it starts Xorg with
hardcoded 1920x1080 resolution (which will later be updated by the
qubes.SetMonitorLayout qrexec call), selects which events it want to
receive and then waits for the GUI daemon. Especially, no events are
actually processed before GUI daemon connects. This assumes all events
will be queued and can be processed after GUI daemon connection. Very
similar approach is already taken on GUI daemon re-connection, and it
works.
This makes the msg_xconf sent by the gui-daemon completely ignored.
There is a potential issue, if too many events get queued before GUI
daemon connects and some get dropped. It's unclear how Xlib handles that
(and what is the limit), but if that happens there are two alternative
solutions:
1. Start processing events normally, especially collect info about all
relevant windows, but dont send anything to GUI daemon before it
connects - this basically requires changing write_struct() (and other
similar places) to check if GUI daemon is connected. And once GUI daemon
connects (first event received on the vchan FD), call
send_all_windows_info().
2. Wait for GUI daemon before registering for events, but then iterate
over all windows to collect necessary info and send it to dom0. This
approach theoretically can be more reliable (and might even allow
restarting gui-agent without restarting Xorg as a side effect), but it's
unclear if all data can be rebuilt this way. Especially tray icons may
be problematic, as it isn't any window property, but a message sent to
relevant selection owner (but theoretically
https://tronche.com/gui/x/icccm/sec-2.html#s-2.8 provides
solution for this issue).
QubesOS/qubes-issues#9940 (comment)1 parent 31d173c commit 3e53341
2 files changed
+35
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2176 | 2176 | | |
2177 | 2177 | | |
2178 | 2178 | | |
2179 | | - | |
2180 | | - | |
2181 | | - | |
| 2179 | + | |
2182 | 2180 | | |
2183 | 2181 | | |
2184 | 2182 | | |
| 2183 | + | |
2185 | 2184 | | |
2186 | 2185 | | |
2187 | 2186 | | |
2188 | 2187 | | |
2189 | 2188 | | |
2190 | 2189 | | |
2191 | 2190 | | |
2192 | | - | |
2193 | | - | |
2194 | | - | |
2195 | | - | |
| 2191 | + | |
2196 | 2192 | | |
2197 | 2193 | | |
2198 | 2194 | | |
| |||
2374 | 2370 | | |
2375 | 2371 | | |
2376 | 2372 | | |
2377 | | - | |
2378 | | - | |
2379 | | - | |
2380 | | - | |
2381 | | - | |
2382 | | - | |
2383 | | - | |
2384 | | - | |
2385 | | - | |
2386 | | - | |
2387 | | - | |
2388 | | - | |
2389 | | - | |
2390 | | - | |
2391 | | - | |
2392 | | - | |
2393 | | - | |
2394 | | - | |
2395 | 2373 | | |
2396 | 2374 | | |
2397 | 2375 | | |
| 2376 | + | |
| 2377 | + | |
2398 | 2378 | | |
2399 | 2379 | | |
2400 | 2380 | | |
| |||
2407 | 2387 | | |
2408 | 2388 | | |
2409 | 2389 | | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
2410 | 2393 | | |
2411 | 2394 | | |
2412 | 2395 | | |
2413 | 2396 | | |
2414 | 2397 | | |
2415 | | - | |
2416 | 2398 | | |
2417 | 2399 | | |
2418 | 2400 | | |
| |||
2425 | 2407 | | |
2426 | 2408 | | |
2427 | 2409 | | |
2428 | | - | |
2429 | | - | |
2430 | 2410 | | |
2431 | 2411 | | |
2432 | 2412 | | |
| |||
2580 | 2560 | | |
2581 | 2561 | | |
2582 | 2562 | | |
2583 | | - | |
2584 | | - | |
2585 | | - | |
2586 | | - | |
2587 | | - | |
2588 | | - | |
2589 | | - | |
2590 | | - | |
2591 | | - | |
2592 | | - | |
2593 | | - | |
2594 | 2563 | | |
| 2564 | + | |
2595 | 2565 | | |
2596 | 2566 | | |
2597 | 2567 | | |
| |||
2607 | 2577 | | |
2608 | 2578 | | |
2609 | 2579 | | |
2610 | | - | |
2611 | | - | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
2612 | 2584 | | |
2613 | 2585 | | |
2614 | 2586 | | |
| |||
2677 | 2649 | | |
2678 | 2650 | | |
2679 | 2651 | | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
2680 | 2666 | | |
2681 | 2667 | | |
2682 | 2668 | | |
| |||
0 commit comments