Title: Widget can't be positioned on primary monitor in stacked multi-monitor setups
Describe the bug
When using two monitors in a stacked layout (one above the other) where the primary monitor is the bottom screen, the widget is always drawn on the top (non-primary) monitor regardless of the position sliders. The sliders max out at 100% which corresponds exactly to the edge of the non-primary monitor, making the primary screen completely unreachable.
Root cause
In src/extension.ts, _updatePosition() correctly reads the primary monitor's geometry but does not add its offset to the final position:
// Current code
const monitor = Main.layoutManager.primaryMonitor;
const x = (monitor.width * this._settings.get_double('position-x')) / 100;
const y = (monitor.height * this._settings.get_double('position-y')) / 100;
this.set_position(Math.round(x), Math.round(y));
set_position uses global desktop coordinates, but monitor.width/height alone gives a position relative to the top-left corner of the combined desktop (which belongs to the non-primary monitor in a stacked layout), not relative to the primary monitor itself.
Fix
Add monitor.x and monitor.y offsets to the final set_position call:
this.set_position(monitor.x + Math.round(x), monitor.y + Math.round(y));
To reproduce
- Set up two monitors in a stacked layout (monitor 2 above monitor 1)
- Set monitor 1 as primary in GNOME Displays settings
- Enable the vitals widget — it appears on monitor 2
- Drag the vertical slider to 100% — widget stops exactly at the boundary between the two screens
Environment
- OS: CachyOS (Arch-based)
- GNOME Shell version: 50.2
- Display server: Wayland
- GPU: AMD RX 9070 XT
Title: Widget can't be positioned on primary monitor in stacked multi-monitor setups
Describe the bug
When using two monitors in a stacked layout (one above the other) where the primary monitor is the bottom screen, the widget is always drawn on the top (non-primary) monitor regardless of the position sliders. The sliders max out at 100% which corresponds exactly to the edge of the non-primary monitor, making the primary screen completely unreachable.
Root cause
In
src/extension.ts,_updatePosition()correctly reads the primary monitor's geometry but does not add its offset to the final position:set_positionuses global desktop coordinates, butmonitor.width/heightalone gives a position relative to the top-left corner of the combined desktop (which belongs to the non-primary monitor in a stacked layout), not relative to the primary monitor itself.Fix
Add
monitor.xandmonitor.yoffsets to the finalset_positioncall:To reproduce
Environment