Skip to content

Commit e10ee88

Browse files
authored
fix issue where opening the first window would crash (#55)
1 parent bfb3fd4 commit e10ee88

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "winri"
33
description = "A window scrolling tiler for Windows 11"
4-
version = "0.2.0"
4+
version = "0.2.1"
55
edition = "2024"
66
license = "MIT"
77

src/tiler.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,9 @@ impl ScrollTiler {
216216
/// If the focused window is tiled, new windows are appended after it.
217217
/// Otherwise, they are appended at the end.
218218
fn append_new_windows(&mut self, windows_snapshot: &HashSet<Window>) {
219-
if let Some(focus_index) = self.focus_index().or(self.previously_focused_window_index) {
219+
if let Some(focus_index) = self.focus_index().or(self.previously_focused_window_index)
220+
&& !self.windows.is_empty()
221+
{
220222
for window in windows_snapshot {
221223
if !self
222224
.windows

0 commit comments

Comments
 (0)