Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/video/x11/SDL_x11framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ static int shm_errhandler(Display *d, XErrorEvent *e)
static SDL_bool have_mitshm(Display *dpy)
{
/* Only use shared memory on local X servers */
/* Given that Windows 10 and 11 now offer use of OpenSSH, checking for a
SSH_TTY value (man ssh(1)) is potentially an OS-agnostic means of
detecting a common case of using a remote X server: when accessing via
X11 forwarding over `ssh -X`. */
/* (Linux-specific alternative: checking if XDG_SESSION_TYPE == "tty" (see
man pam_systemd(8))) */
const char *ssh_tty = SDL_getenv("SSH_TTY");
if (ssh_tty != NULL && SDL_strlen(ssh_tty) > 0) {
return SDL_FALSE;
}
return X11_XShmQueryExtension(dpy) ? SDL_X11_HAVE_SHM : SDL_FALSE;
}

Expand Down
Loading