From 322b91b51f45ea6bbdffae52b8bcbd559313efc8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 17 Aug 2025 19:59:44 +0530 Subject: [PATCH] Only use Wayland if loading the glfw-wayland.so DLL succeeds --- kitty/constants.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: