Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshots wrong when display rotated #3259

Closed
DAVID9SE opened this issue Feb 29, 2024 · 6 comments · Fixed by #3292 or #3299
Closed

Screenshots wrong when display rotated #3259

DAVID9SE opened this issue Feb 29, 2024 · 6 comments · Fixed by #3292 or #3299
Labels
triaged Triage into JIRA to plan it in

Comments

@DAVID9SE
Copy link

DAVID9SE commented Feb 29, 2024

Hi!
I am using ubuntu frame for a kiosk. Everything went smoothly but now I am trying to implement screenshot-based sanity checks. When I call ubuntu-frame.screenshot the output image is shifted.

I am using a 1920x1080@60.0 screen that is rotated so orientation is set to left.
The program running is wpe-webkit-mir-kiosk.

Thanks a lot in advance

@Saviq Saviq added the triaged Triage into JIRA to plan it in label Feb 29, 2024
@Saviq
Copy link
Collaborator

Saviq commented Feb 29, 2024

Thanks @DAVID9SE, I can confirm this happening, thanks for letting us know, we'll get to work on a fix soon.

@Saviq Saviq transferred this issue from canonical/ubuntu-frame Feb 29, 2024
@Saviq Saviq changed the title Screenshot outputs weirdly shifted image. Screenshots wrong when display rotated Feb 29, 2024
@Saviq
Copy link
Collaborator

Saviq commented Feb 29, 2024

Reproducer:

# cat display.config
layouts:
  default:
    cards:
    - card-id: 0
      unknown-1:
        orientation: left
$ WAYLAND_DISPLAY=wayland-1 ./build-Debug/bin/miral-shell --display-config=static=$PWD/display.config --add-wayland-extensions all &
$ WAYLAND_DISPLAY=wayland-1 grim

@Saviq
Copy link
Collaborator

Saviq commented Feb 29, 2024

Actually… this may be a problem with grim, as ubuntu-frame-vnc seems to be doing fine (except for rotated input, which is a separate issue).

@mattkae
Copy link
Contributor

mattkae commented Feb 29, 2024

Maybe related: #3236

This may be one big issue with our clip area disrespecting transformations

@mattkae
Copy link
Contributor

mattkae commented Mar 18, 2024

This looks quite suspect:

// TODO: send correct output transform

@mattkae
Copy link
Contributor

mattkae commented Mar 18, 2024

Update for posterity's sake: setting the correct transform actually hurts us a lot more than it should. However, using a buffer size that has the correctly transformed extents fixes us 😄

mattkae added a commit that referenced this issue Mar 18, 2024
mattkae added a commit that referenced this issue Mar 19, 2024
github-merge-queue bot pushed a commit that referenced this issue Apr 8, 2024
## Release Notes
mir (2.16.4) UNRELEASED; urgency=medium

  * Bugfix release:
    - Ignoring zero length gamma curves for KMS outputs (Fixes: #3238)
    - Add hardware cursor support (Fixes: #3198)
- Screenshots now respect clipping areas and rotated outputs (Fixes:
#3236)
      (Fixes: #3259)
    - Fixed custom attributes propagation on outputs
      (Fixes: canonical/ubuntu-frame#172)
    - Handle the Ubuntu 64-bit time_t apocalypse (Fixes: #3285)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged Triage into JIRA to plan it in
Projects
None yet
3 participants