console.lua,wayland_common: also detect Wayland if WAYLAND_SOCKET set

While most Wayland compositors provide a socket path indicated by
environment variable WAYLAND_DISPLAY, others may sometimes bequeath a
socket file descriptor specified by WAYLAND_SOCKET.
This commit is contained in:
M Stoeckl
2024-11-17 14:11:57 -05:00
committed by Dudemanguy
parent 998bdef1d0
commit 46574d479d
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ local function detect_platform()
local platform = mp.get_property_native('platform')
if platform == 'darwin' or platform == 'windows' then
return platform
elseif os.getenv('WAYLAND_DISPLAY') then
elseif os.getenv('WAYLAND_DISPLAY') or os.getenv('WAYLAND_SOCKET') then
return 'wayland'
end
return 'x11'