Skip to content

Commit b843494

Browse files
committed
Fix wallpaper misalignment in overview when corner radius > 0
RoundedCornersEffect's pixel_step was derived from the physical monitor resolution (Main.layoutManager.monitors) instead of the actual size of the background actor the effect is attached to. This is a no-op for the real desktop background, which happens to match the monitor's resolution, but GNOME also creates smaller background actors for workspace previews/thumbnails in the overview, where backgroundActor.width/height is much smaller than the monitor. With corner radius 0 the mismatch is invisible since there's no rounding to distort; with radius > 0 the shader's pixel_step no longer matches the coordinate space bounds is expressed in, misaligning the rounded clip relative to the actual overview background. Derive pixel_step from backgroundActor's own size at construction, and recompute it on every allocation change alongside the existing bounds recalculation, mirroring how bounds already handles actor-size changes. Fixes #239
1 parent 6783f7a commit b843494

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/wallpaper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const LiveWallpaper = GObject.registerClass(
116116
this.roundedCornersEffect = new RoundedCornersEffect();
117117
this.backgroundActor.add_effect(this.roundedCornersEffect);
118118

119-
this.setPixelStep(this.monitorWidth, this.monitorHeight);
119+
this.setPixelStep(this.monitorWidth.width, this.monitorHeight.height);
120120
this.setRoundedClipRadius(0.0);
121121
this.setBorderStroke(0);
122122
this.setBorderColor([1.0, 0.0, 0.0, 1.0]);
@@ -135,12 +135,13 @@ export const LiveWallpaper = GObject.registerClass(
135135
})
136136
);
137137
}
138-
this.setRoundedClipBounds(0, 0, this.monitorWidth, this.monitorHeight);
138+
this.setRoundedClipBounds(0, 0, this.monitorWidth.width, this.monitorHeight.height);
139139

140140
this.connect('notify::allocation', () => {
141141
if (!this.wallpaper)
142142
return;
143143
try {
144+
this.setPixelStep(this.width, this.height);
144145
this.applyBounds();
145146
const stroke = this.settings.get_int('border-stroke');
146147
this.roundedCornersEffect.setBorderStroke(stroke * this.monitorScale);

0 commit comments

Comments
 (0)