aboutsummaryrefslogtreecommitdiff
path: root/include/protocol.h
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2021-09-20 23:43:10 +0200
committerKenny Levinsen <kl@kl.wtf>2021-09-21 11:18:18 +0200
commit2eee9aa445e3f9dc6a7ca115489f87b10f60b9ba (patch)
treecad3b877c4c478004f8c1ba3c460dde8cbcaadaf /include/protocol.h
parent0f20175752b7b11a5c66070b2dedc4cf8716d107 (diff)
seatd: Implement ping request to wake up later
When device open or close messages are sent to seatd, libseat must read messages from the socket until it sees the associated response message. This means that it may drain enable/disable seat events from the socket, queueing them internally for deferred processing. As the socket is drained, the caller will not wake from a poll and have no reason to dispatch libseat. To ensure that these messages would not be left in the queue, 6fa82930d0c5660eea3102989c765dc864514e36 made it so that open/close calls would execute all queued events just before returning. Unfortunately, this had the side-effect of having events fire from the stack of libseat_open_device or libseat_close_device, which we now see cause problems in compositors. Specifically, an issue has been observed where libinput end up calling libseat_close_device, which in turn dispatch a disable seat event that calls libinput_suspend. libinput does not like this. Instead, remove the execution from libseat_open_device and libseat_close_device, and instead make a "ping" request to seatd if events have been queued. The response to this will wake us up and ensure that dispatch is called.
Diffstat (limited to 'include/protocol.h')
-rw-r--r--include/protocol.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/protocol.h b/include/protocol.h
index b3361ba..cb994fc 100644
--- a/include/protocol.h
+++ b/include/protocol.h
@@ -15,6 +15,7 @@
#define CLIENT_CLOSE_DEVICE CLIENT_EVENT(4)
#define CLIENT_DISABLE_SEAT CLIENT_EVENT(5)
#define CLIENT_SWITCH_SESSION CLIENT_EVENT(6)
+#define CLIENT_PING CLIENT_EVENT(7)
#define SERVER_SEAT_OPENED SERVER_EVENT(1)
#define SERVER_SEAT_CLOSED SERVER_EVENT(2)
@@ -22,6 +23,7 @@
#define SERVER_DEVICE_CLOSED SERVER_EVENT(4)
#define SERVER_DISABLE_SEAT SERVER_EVENT(5)
#define SERVER_ENABLE_SEAT SERVER_EVENT(6)
+#define SERVER_PONG SERVER_EVENT(7)
#define SERVER_ERROR SERVER_EVENT(0x7FFF)
#include <stdint.h>