Skip to content

Commit 98ba632

Browse files
committed
fix: guard against zero frame width in overview shadow allocation
vfunc_allocate on the overview shadow clone can be called before the window has a valid frame rect, causing division by zero which produces NaN values in the allocation box and triggers Clutter assertion failures.
1 parent 367c4c3 commit 98ba632

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/patch/add_shadow_in_overview.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,15 @@ const OverviewShadowActorClone = GObject.registerClass(
113113
return;
114114
}
115115

116+
const frameWidth = metaWindow.get_frame_rect().width;
117+
if (frameWidth === 0) {
118+
return;
119+
}
120+
116121
// Scale the shadow by the same scale factor that the window preview
117122
// is scaled by.
118123
const containerScaleFactor =
119-
windowContainerBox.get_width() /
120-
metaWindow.get_frame_rect().width;
124+
windowContainerBox.get_width() / frameWidth;
121125
const paddings =
122126
SHADOW_PADDING *
123127
containerScaleFactor *

0 commit comments

Comments
 (0)