From 5e2fc4e90ff5d80be5e83390fe5b4c2ebaa6f0ea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 28 May 2024 20:03:10 +0530 Subject: [PATCH] Fix a regression in the previous release causing an error when setting background_opacity to zero Fixes #7483 --- docs/changelog.rst | 2 ++ kitty/boss.py | 2 +- kitty/rc/set_background_opacity.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a560b0abd..06c53b33a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -57,6 +57,8 @@ Detailed list of changes - Fix a regression in the previous release that caused horizontal scrolling via touchpad in fullscreen applications to be reversed on non-Wayland platforms (:iss:`7475`, :iss:`7481`) +- Fix a regression in the previous release causing an error when setting background_opacity to zero (:iss:`7483`) + 0.35.0 [2024-05-25] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/boss.py b/kitty/boss.py index 88d3be4b2..121e9bc27 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -1325,7 +1325,7 @@ class Boss: tm.resize() def _set_os_window_background_opacity(self, os_window_id: int, opacity: float) -> None: - change_background_opacity(os_window_id, max(0.1, min(opacity, 1.0))) + change_background_opacity(os_window_id, max(0.0, min(opacity, 1.0))) @ac('win', ''' Set the background opacity for the active OS Window diff --git a/kitty/rc/set_background_opacity.py b/kitty/rc/set_background_opacity.py index 9ce327871..4f1776a04 100644 --- a/kitty/rc/set_background_opacity.py +++ b/kitty/rc/set_background_opacity.py @@ -67,7 +67,7 @@ equal to the specified value, otherwise it will be set to the specified value. raise OpacityError('You must turn on the dynamic_background_opacity option in kitty.conf to be able to set background opacity') windows = self.windows_for_payload(boss, window, payload_get) for os_window_id in {w.os_window_id for w in windows if w}: - val: float = payload_get('opacity') + val: float = payload_get('opacity') or 0. if payload_get('toggle'): current = background_opacity_of(os_window_id) if current == val: