From fd94f2581ef3876a573d0ea388b3b87483b8ae58 Mon Sep 17 00:00:00 2001 From: Devin Lehmacher Date: Mon, 22 Sep 2025 01:54:02 -0400 Subject: [PATCH] Fix toggle mode on set_background_opacity remote_command --- kitty/rc/set_background_opacity.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/rc/set_background_opacity.py b/kitty/rc/set_background_opacity.py index d7c0c7897..ab44acf0b 100644 --- a/kitty/rc/set_background_opacity.py +++ b/kitty/rc/set_background_opacity.py @@ -70,7 +70,10 @@ equal to the specified value, otherwise it will be set to the specified value. val: float = payload_get('opacity') or 0. if payload_get('toggle'): current = background_opacity_of(os_window_id) - if current == val: + # GLFW represents opacity as a float internally, but python's + # "float" type has double precision, so we can't rely on precise + # equality here + if abs(current - val) <= 0.0001: val = opts.background_opacity boss._set_os_window_background_opacity(os_window_id, val) return None