From b92c9b6b92f154bb8eb7dc73d765d82c7dad4ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Nystr=C3=B6m?= <35500074+antonnyst@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:24:16 +0100 Subject: [PATCH] fix: Add mut to fix incorrect get of windowsize in cover --- CHANGELOG.md | 6 ++++++ src/ui/cover.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85dab696..5c767e89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Fix error in fetching of window size leading to crashes with cover feature + ## [1.2.0] - 2024-10-15 ### Added diff --git a/src/ui/cover.rs b/src/ui/cover.rs index 4466841f..f5827c32 100644 --- a/src/ui/cover.rs +++ b/src/ui/cover.rs @@ -33,8 +33,8 @@ impl CoverView { pub fn new(queue: Arc, library: Arc, config: &Config) -> Self { // Determine size of window both in pixels and chars let (rows, cols, mut xpixels, mut ypixels) = unsafe { - let query: (u16, u16, u16, u16) = (0, 0, 0, 0); - ioctl(1, TIOCGWINSZ, &query); + let mut query: (u16, u16, u16, u16) = (0, 0, 0, 0); + ioctl(1, TIOCGWINSZ, &mut query); query };