aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2021-09-21clang-format: Fix alignmentKenny Levinsen
2021-09-21seatd: Implement ping request to wake up laterKenny Levinsen
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.
2021-09-02seat: Avoid holding a tty fdKenny Levinsen
The kernel Secure Attention Key killer, triggered by SysRq+k, kills all processes that hold an fd referencing the tty. To avoid its attention, we stop storing the fd for the currently active VT in seat state. This has the added benefit of simplifying state a bit.
2021-08-15libseat: Update builtin backend root requirement documentationGreg Depoire--Ferrer
The builtin backend no longer requires root, setuid or CAP_SYS_ADMIN. This commit updates the documentation accordingly.
2021-08-15Make libseat_seat_listener constSimon Ser
libseat will never write to that struct. Let's allow callers to make it read-only.
2021-03-26Add no-op sessionSimon Ser
This is useful for headless testing, for instance with VKMS: modprobe vkms export WLR_DRM_DEVICES=/dev/dri/card1 export WLR_BACKENDS=drm export LIBSEAT_BACKEND=noop sway We don't need any of the VT handling in this case.
2021-03-02log: Include debug logs in release buildsKenny Levinsen
2021-03-01log: Remove function name from logKenny Levinsen
2021-02-27libseat: Fix typo in doc stringKenny Levinsen
2021-02-27seatd: Tear down VT when disabled client closesKenny Levinsen
If a client closed while it was disabled, the VT would not be torn down. If the user navigated back to the VT it belonged to, they would be stuck. When a client is disabled, open the fd for the VT it belonged to and perform regular teardown on it.
2021-02-27client: Replace pending_disable with state enumKenny Levinsen
This simplifies logic in seat handling.
2020-09-22terminal: Ack both release and acquireKenny Levinsen
Linux only requires acking release and ignores ack of acquire, but FreeBSD is more stringent and will patiently wait for both to be acked. Implement proper acking for both events.
2020-09-22seat: Rework seat activation/switch logicKenny Levinsen
The seat activation logic did not correctly handle VT switching and switching between multiple sessions. Session switching on VT-bound seats is now performed using a VT switch, taking advantage of VT signals to perform the actual switch. This simplifies switching logic and makes it more robust.
2020-09-22poller: Raise signals through self-pipeKenny Levinsen
Signal handling relied on poll(2) being interrupted by signals, followed by a check for signal handlers flagging a signal as received. This only allowed signals that were received during poll(2) to be handled correctly. Implement the usual self-pipe implementation, where signal handlers write an arbitrary byte to a polled file descriptor to ensure proper level-triggered signal handling.
2020-08-31client: Do not leak idle clients on exitKenny Levinsen
2020-08-31test: Add test_run and test_assert macrosKenny Levinsen
test_run and test_assert replaces regular assert with better logging which include the currently running test name. The tests can now also be built without DEBUG.
2020-08-31Remove unused list implementationKenny Levinsen
2020-08-31poller: Convert to linked_listKenny Levinsen
2020-08-31server: Convert seat list to linked_listKenny Levinsen
2020-08-31poller: Make event sources opaqueKenny Levinsen
2020-08-30seatd: Remove unused device_closed msg bodyKenny Levinsen
2020-08-30linked_list: Implement linked_list_takeKenny Levinsen
2020-08-29seat: Destroy all clients on teardownKenny Levinsen
2020-08-29protocol: Add note to remove device_closed msgKenny Levinsen
The content of this message is unused, so it should be converted to a content-less message.
2020-08-29libseat: Improve logging with seatd conn helpersKenny Levinsen
Add helpers around connection access to have all logging centralized and reduce code duplication. Improve existing helpers to further reduce code duplication. The seatd backend should have much better logging after this.
2020-08-28Introduce libseat_set_log_levelSimon Ser
The default level is SILENT. log_init no longer takes an initial log level (so that calls to libseat_set_log_level prior to log_init work correctly).
2020-08-28Introduce libseat_set_log_handlerSimon Ser
This allows libseat users to register a custom logging function.
2020-08-28Rename enum log_level to libseat_log_levelSimon Ser
This is preparatory work for exposing a public function to set libseat's log handler.
2020-08-07seatd: Add command-line argumentsKenny Levinsen
2020-08-05libseat: Fix doc typoKenny Levinsen
2020-08-05libseat: Rename libseat_impl to seat_implKenny Levinsen
2020-08-05log: Remove libseat prefixesKenny Levinsen
2020-08-05Remove pointless compiler.hKenny Levinsen
2020-08-03seat: Convert client list to linked listKenny Levinsen
2020-08-03seat: Convert device list to linked listKenny Levinsen
2020-08-03linked_list: Initial implementationKenny Levinsen
2020-08-03server: Stack-allocate the serverKenny Levinsen
2020-08-03poller: Inline the poller into the server structKenny Levinsen
2020-08-03poller: Remove unnecessary poll_impl abstractionKenny Levinsen
2020-08-03libseat: Remove unused stdarg.h importKenny Levinsen
2020-08-03compiler: Rename erroneous header-guardKenny Levinsen
2020-08-03terminal: Remove unused prototypesKenny Levinsen
2020-08-03list: Make list_concat argument constKenny Levinsen
2020-08-03client: Prefix notification methods with 'send'Kenny Levinsen
2020-08-03libseat: Use symbol file instead of -fvisibilityKenny Levinsen
2020-08-02seat: Deactivate devices before sending disableKenny Levinsen
Previously, seatd would not deactivate devices until the client had acked the disable. In once instance, this lead to libinput spending significant time checking and closing each input device. As a workaround, mimick logind's behavior of deactivating devices first. The original behavior can be reintroduced if the client-side problem is fixed. Closes: https://todo.sr.ht/~kennylevinsen/seatd/5
2020-08-02list: Add list_pop_backKenny Levinsen
2020-08-02seat: Open/close tty on activation/deactivationKenny Levinsen
The VT and KD ioctl's are picky about the tty fd used. In order to satisfy these, and to improve state cleanup, we now only and store the current tty when opening a client, and use this fd to perform teardown later. The presence of the fd is also used to signal that teardown is needed.
2020-08-01Remove ALWAYS_INLINEKenny Levinsen
Didn't do what I wanted it to anyway.
2020-08-01connection: Shrink buffers from 1KB to 256B eachKenny Levinsen