Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for tracking systemd's session events in addition to the already supported seat events. This is done by adding a new systemd monitor to the event loop. The only functionality added so far is to check for updates on a session's type. On any session event, each seat will receive a UTERM_MONITOR_UPDATE_SESSIONS event. Each seat then checks the type of all of its sessions and checks whether it has been changed. If it has changed, the awake status of the session's terminal is updated appropriately.
When a graphical session is launched from a kmscon terminal, it will update the session type from "tty" to "wayland"/"x11". This property was used to update a terminal's awake status to false when a graphical session is launched within it. This prevents the terminal from reading keyboard events, thus fixing dvdhrm#144. It also prevents other unnecessary background updates. When a graphical session is exited, the session's type is reverted to "tty", thus the terminal can then be updated to awake again.