Skip to content

Camera offset/misaligned when using --output with --monitor on non-primary monitor #39

Description

@FatngatirBilek

Description

When using --output <name> together with --monitor <name> on a monitor that isn't at position (0,0) in the compositor's global coordinate space, the initial camera view is offset/misaligned — the visible content isn't centered and you have to manually zoom out and drag to find the actual screenshot content.

Setup

Two monitors in Hyprland:

  • eDP-1: 1920x1080 at position 0x0
  • HDMI-A-1: 1920x1080 at position 1920x0

Command used

console woomer --monitor HDMI-A-1 --output HDMI-A-1 ​

Expected behavior

The screenshot content should be centered/aligned correctly in the view on launch.

Actual behavior

The view appears to target coordinates from the monitor's global position, while screenshot_single_output returns image data local to that output starting at (0,0). This mismatch causes the camera to look at the wrong region until manually zoomed/panned back into frame.

Suspected cause

In main.rs, the initial camera target is set using display_output.logical_region.inner.position (global compositor coordinates):

rust rl_camera.target = Vector2::new( display_output.logical_region.inner.position.x as f32, display_output.logical_region.inner.position.y as f32, ); ​

But when --output is passed, screenshot_single_output returns an image local to that output (starting at 0,0), not the global compositor position. So the camera target and the loaded texture use two different coordinate spaces.

Suggested fix

When --output is provided, the camera target should probably be (0, 0) (or relative to the output's own region) instead of the monitor's global position.

Environment

  • OS: NixOS
  • Compositor: Hyprland
  • woomer version: 0.2.0

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