diff --git a/kitty/constants.py b/kitty/constants.py index 333f2f1f1..bbd01d51f 100644 --- a/kitty/constants.py +++ b/kitty/constants.py @@ -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: