From f5042cb2e1229bd20ac68bb4dd2ac90af52358e6 Mon Sep 17 00:00:00 2001 From: JamiePhonic Date: Sat, 24 Aug 2024 23:46:21 +0100 Subject: [PATCH] Added check for 0 display width/height Disable display if width/height are 0. Should fix #331 --- aioslimproto/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aioslimproto/client.py b/aioslimproto/client.py index d629629..3113e73 100644 --- a/aioslimproto/client.py +++ b/aioslimproto/client.py @@ -976,7 +976,9 @@ def _process_setd(self, data: bytes) -> None: resolution = f"{display_width} x {display_height}" self.callback(self, EventType.PLAYER_DISPLAY_RESOLUTION, resolution) - if self.display_control.image.width != display_width: + if display_width == 0 or display_height == 0: + self.display_control.disabled(True) # noqa: FBT003 + elif self.display_control.image.width != display_width: # If the display resolution reported by the player doesn't match # the display resolution we're currently using self.display_control = None