From a8f6b0a47fb9ead8343832e0c88300429de6ecdc Mon Sep 17 00:00:00 2001 From: Max Verevkin Date: Sun, 1 May 2022 13:21:52 +0300 Subject: Surface::draw(): check if surface is configured Fixes a protocol error. --- src/bar_state.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/bar_state.rs b/src/bar_state.rs index 2cbb677..a7937e2 100644 --- a/src/bar_state.rs +++ b/src/bar_state.rs @@ -327,6 +327,10 @@ impl Surface { } fn draw(&mut self, blocks: &[Block], blocks_cache: &mut Vec) { + if self.dimensions == (0, 0) { + return; + } + let config = self.config.borrow(); let stride = 4 * self.dimensions.0 as i32; -- cgit v1.3.1