Skip to content

Commit 2258c46

Browse files
authored
Merge pull request #638 from neuromorph/master
fix: multi-monitor panel blur - #637
2 parents 0c95918 + 663e207 commit 2258c46

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/components/panel.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,18 @@ export const PanelBlur = class PanelBlur {
237237
// sometimes yields NaN (probably when the actor is not fully
238238
// positionned yet)
239239
let [p_x, p_y] = panel_box.get_position();
240-
let x = p_x + (width - panel.width)/2;
241-
let y = p_y + (height - panel.height)/2;
240+
let [p_p_x, p_p_y] = panel_box.get_parent().get_position();
241+
let x = p_x + p_p_x - monitor.x + (width - panel.width)/2;
242+
let y = p_y + p_p_y - monitor.y + (height - panel.height)/2;
243+
242244
background.set_clip(x, y, panel.width, panel.height);
243245
background.x = (width - panel.width)/2 - x;
244246
background.y = (height - panel.height)/2 - y;
245247
} else {
246-
background.x = panel_box.x;
247-
background.y = panel_box.y;
248-
background.width = width;
249-
background.height = height;
248+
background.x = panel.x;
249+
background.y = panel.y;
250+
background.width = panel.width;
251+
background.height = panel.height;
250252
}
251253

252254
// update the monitor panel is on

0 commit comments

Comments
 (0)