Fix a regression in the previous release causing an error when setting background_opacity to zero

Fixes #7483
This commit is contained in:
Kovid Goyal
2024-05-28 20:03:10 +05:30
parent 48070ff38e
commit 5e2fc4e90f
3 changed files with 4 additions and 2 deletions

View File

@@ -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 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] 0.35.0 [2024-05-25]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -1325,7 +1325,7 @@ class Boss:
tm.resize() tm.resize()
def _set_os_window_background_opacity(self, os_window_id: int, opacity: float) -> None: 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', ''' @ac('win', '''
Set the background opacity for the active OS Window Set the background opacity for the active OS Window

View File

@@ -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') 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) windows = self.windows_for_payload(boss, window, payload_get)
for os_window_id in {w.os_window_id for w in windows if w}: 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'): if payload_get('toggle'):
current = background_opacity_of(os_window_id) current = background_opacity_of(os_window_id)
if current == val: if current == val: