Skip to content

Widget can't be positioned on primary monitor in stacked multi-monitor setups #5

Description

@Nyanko-S3nsei

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

  1. Set up two monitors in a stacked layout (monitor 2 above monitor 1)
  2. Set monitor 1 as primary in GNOME Displays settings
  3. Enable the vitals widget — it appears on monitor 2
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions