Only use Wayland if loading the glfw-wayland.so DLL succeeds

This commit is contained in:
Kovid Goyal 2025-08-17 19:59:44 +05:30
parent a2d76a6c34
commit 322b91b51f
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -203,7 +203,11 @@ def detect_if_wayland_ok() -> bool:
wayland = glfw_path('wayland')
if not os.path.exists(wayland):
return False
return True
import ctypes
with suppress(Exception):
setattr(detect_if_wayland_ok, 'keep_module_loaded', ctypes.CDLL(wayland))
return True
return False
def is_wayland(opts: Optional['Options'] = None) -> bool: