Firejail discusses this briefly in their X11 guide:
The sandbox replaces the regular X11 server with Xpra or Xephyr server. This prevents X11 keyboard loggers and screenshot utilities from accessing the main X11 server.
It's not a common issue, but obviously a security concern to make it so easy for keyloggers to record your keypresses or screen. I currently prefer X11 to Wayland, and I'd love if this problem was possible to address without Firejail. I use Firejail for other sandboxing tasks, but sandboxing X11 is too impractical.
The sandbox replaces the regular X11 server with Xpra or Xephyr server. This prevents X11 keyboard loggers and screenshot utilities from accessing the main X11 server.
https://firejail.wordpress.com/documentation-2/x11-guide
It's not a common issue, but obviously a security concern to make it so easy for keyloggers to record your keypresses or screen. I currently prefer X11 to Wayland, and I'd love if this problem was possible to address without Firejail. I use Firejail for other sandboxing tasks, but sandboxing X11 is too impractical.