switching between clients on seat should be synchronized

I'm using sway both for greeter with gtkgreet and as my wm. I have VT1 and VT6 configured to run sway/gtkgreet. On boot i'm being dropped to VT1 by default where sway/gtkgreet starts successfully. Then I login on VT1, greetd started sway/gtkgreet exists, and my user WM sway starts. Now if I press Alt+Ctrl+f6 to go to VT6, greetd there will attempt to start another sway/gtkgreet on waitactive. Second sway/gtkgreet attempts to open a number of devices which are still acquired by sway/WM on VT1 and fails with:

00:00:00.004 [DEBUG] [sway/server.c:47] Preparing Wayland server initialization
00:00:00.004 [ERROR] [wlr] [libseat] [libseat/backend/seatd.c:301] Could not poll connection: Broken pipe
00:00:00.004 [INFO] [wlr] [libseat] [libseat/libseat.c:70] Backend 'seatd' failed to open seat, skipping

Because seatd fails with:

00:28:35.558 [INFO] [seatd/server.c:140] New client connected (pid: 2720, uid: 0, gid: 999)
00:28:35.558 [ERROR] [seatd/seat.c:152] Could not add client: seat is VT-bound and has an active client
00:28:35.558 [ERROR] [seatd/client.c:149] Could not add client to target seat: Device or resource busy

After sway/WM on VT1 finally completes cleanup and gets disabled:

00:28:36.126 [INFO] [seatd/seat.c:571] Disabled client 1 on seat0

Second sway/gtkgreet successfully starts on VT6.

After discussion on IRC, we concluded that most likely some synchronization is required. If new client arriving while another client is in progress of disabling, newly arrived client could wait until client being disabled is done.

Assigned to
3 months ago
2 months ago
No labels applied.

~kennylevinsen 2 months ago*

Can you try this commit? https://git.sr.ht/~kennylevinsen/seatd/commit/9d855130eb6ac5542cca4eb2d5a87f60a7a557b1

This allow seat_add_client to let new clients be added on empty VTs if the previous client is being disabled. Its seat_open_client will (gracefully) fail, but it will be activated by the session switch logic once the previous client acks the disable event.

~kennylevinsen REPORTED FIXED 2 months ago

Register here or Log in to comment, or comment via email.