Skip to content

Conversation

@Defenso-QTH
Copy link
Contributor

Description

This PR adds support for VT switching when using KMSDRM in FreeBSD.

Closes #14298

Existing Issue(s)

SDL3 uses /dev/input/event* evdev devices to get input, so these devices need to be readable to the user. It means that the user, and the SDL, can read all events from input devices, including for instance passwords input in other VTs after switching.

In this PR, the SDL simply ignores this content instead of passing it to the application, but for a secure solution, a seat management solution will be necessary. The SDL side could be implemented using libseat which offers compatibility with both seatd and (e)logind.

Testing

Done

  • Tested on FreeBSD 14.3-RELEASE-p5.
  • With applications with FreeRDP 3.17.2 and Ymir 0.2.0.
  • No leaking to underlying text terminal.
  • No input in other VTs ends up in the SDL application.

To-do

  • Test on Linux
  • Other applications?

@slouken
Copy link
Collaborator

slouken commented Oct 28, 2025

This PR failed CI on FreeBSD:

/home/runner/work/SDL/SDL/src/core/freebsd/SDL_evdev_kbd_freebsd.c:340:11: error: unused variable 'devicePath' [-Werror,-Wunused-variable]
  340 |     char *devicePath;
      |           ^~~~~~~~~~
1 error generated.

@Defenso-QTH Defenso-QTH force-pushed the freebsd-vt-switching-pr branch from b8d88a4 to aa542a4 Compare October 29, 2025 03:57
@Defenso-QTH
Copy link
Contributor Author

Sorry, I forgot that one when filtering out debug comments.

@slouken slouken merged commit 3b80fcd into libsdl-org:main Oct 29, 2025
41 of 43 checks passed
@slouken
Copy link
Collaborator

slouken commented Oct 29, 2025

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kmsdrm: VT switching is not implemented for FreeBSD

2 participants