mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 06:15:35 +00:00
wayland: Try to skip the Wayland driver if not connecting to or in a Wayland session
When initializing the Wayland driver, check if the application is being started in, or trying to connect to, a Wayland session and skip to another driver if not. If neither WAYLAND_DISPLAY nor XDG_SESSION_TYPE are set, try to start anyway, and if the Wayland library is missing or no Wayland sessions are started, initialization will fail later in the process as it previously did. This fixes the case where a Wayland session is running on a different VT, but an application wishes to run via KMSDRM on the current VT. (cherry picked from commit 836927edf8da93ca2d3c8dddf7653113da65ce65)
This commit is contained in:
parent
25b0081367
commit
e8c915dacc
|
@ -173,6 +173,14 @@ static SDL_VideoDevice *Wayland_CreateDevice(void)
|
|||
SDL_VideoData *data;
|
||||
struct wl_display *display;
|
||||
|
||||
/* Are we trying to connect to or are currently in a Wayland session? */
|
||||
if (!getenv("WAYLAND_DISPLAY")) {
|
||||
const char *session = getenv("XDG_SESSION_TYPE");
|
||||
if (session && SDL_strcasecmp(session, "wayland")) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!SDL_WAYLAND_LoadSymbols()) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue