From ca5fc80af535a421ac8978bf8a4f2ebdd6bf1f28 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 16 Jan 2021 20:45:29 +1100 Subject: [PATCH] [client] wayland: fix early return preventing signal being set --- client/displayservers/Wayland/wayland.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/displayservers/Wayland/wayland.c b/client/displayservers/Wayland/wayland.c index a8269ef8..73f0cfd3 100644 --- a/client/displayservers/Wayland/wayland.c +++ b/client/displayservers/Wayland/wayland.c @@ -257,16 +257,16 @@ static const struct wl_seat_listener seatListener = { static bool waylandEarlyInit(void) { - if (getenv("SDL_VIDEODRIVER") != NULL) - return true; - - int err = setenv("SDL_VIDEODRIVER", "wayland", 1); - if (err < 0) + if (!getenv("SDL_VIDEODRIVER")) { - DEBUG_ERROR("Unable to set the env variable SDL_VIDEODRIVER: %d", err); - return false; + int err = setenv("SDL_VIDEODRIVER", "wayland", 1); + if (err < 0) + { + DEBUG_ERROR("Unable to set the env variable SDL_VIDEODRIVER: %d", err); + return false; + } + DEBUG_INFO("SDL_VIDEODRIVER has been set to wayland"); } - DEBUG_INFO("SDL_VIDEODRIVER has been set to wayland"); // Request to receive EPIPE instead of SIGPIPE when one end of a pipe // disconnects while a write is pending. This is useful to the Wayland