Selection uses window-local coordinates on monitors with a non-zero X origin (X11, dual monitor) — regression since v14, still present in v15.0.rc1
Flameshot Version
Flameshot v14.0.0 (da6121bd) and v15.0.rc1 (89861c4a), both Qt 6.4.2, official ubuntu-24.04-amd64 .deb from the release page. v12.1.0 (Qt 5.15.12, Ubuntu package) is unaffected.
Installation Type
Downloaded .deb from the GitHub release page
Operating System type and version
Ubuntu 24.04.5 LTS, GNOME 46 on X11, xdg-desktop-portal-gnome 46.2
Description
On a horizontal dual-monitor setup, the region selection is broken on every monitor whose X origin is not 0. The press position is taken in global desktop coordinates, but the drag position is taken in coordinates local to the overlay window, so the selection rectangle is off by exactly the monitor's X origin (2560 px here). Visually, the selection shoots off in the wrong direction and the capture appears to be dragged across the screen.
Monitor layout (xrandr --listactivemonitors):
Monitors: 2
0: +*DP-0 2560/597x1440/336+0+0 <- primary, origin x=0 -> works
1: +DP-2.8 2560/597x1440/336+2560+0 <- origin x=2560 -> brokenSteps to reproduce
- Two monitors side by side, the second one at x offset 2560.
flameshot gui --print-geometry- Drag a rectangle on the second monitor and accept it with Ctrl+C.
- Compare the printed geometry with the rectangle actually dragged.
I drove the drags with XTEST so the input coordinates are exact:
| Drag performed (global coords) | --print-geometry output |
End X expected | End X reported |
|---|---|---|---|
800x600+600+400 (monitor 1) |
800x600+601+401 ✔ |
1400 | 1401 |
800x600+200+100 (monitor 1) |
800x600+201+101 ✔ |
1000 | 1001 |
1200x600+3000+500 (monitor 2) |
-1360x600+3001+501 ✘ |
4200 | 1641 |
400x400+2700+200 (monitor 2) |
-2160x400+2701+201 ✘ |
3100 | 541 |
600x600+4000+400 (monitor 2) |
-1960x600+4001+401 ✘ |
4600 | 2041 |
In every failing case reported_end_x == actual_end_x - 2559, i.e. the drag point is expressed in overlay-window coordinates while the press point stays global. Y is always correct, which fits the layout: both monitors share y origin 0, so the two coordinate spaces only differ along X. The negative widths are the direct consequence.
Expected behaviour
The printed geometry matches the rectangle dragged, on every monitor, as it does in v12.1.0.
Additional context
- Also reproduced on v15.0.rc1, with byte-identical numbers, so PR #4735 ("Fix capture when logical min/max coordinates are not zero") does not cover this case.
- The overlay window itself is placed and sized correctly (
2560x1440+2560+0for the second monitor, checked via the X server); only the pointer coordinates are wrong. - The captured image drawn in the overlay is pixel-identical to the desktop (verified by matching edge positions between a screen grab of the overlay and a clean screen grab: scale 1.000 on both axes), so this is purely a pointer coordinate-space bug, not an image scaling one.
- Possibly the same root cause as #4732 (BSPWM/X11, overlay ends up on the wrong monitor) and #4925 (MATE/X11, capture always lands on the same monitor), and relevant to the rework discussed in #4894.
- Unrelated side observation on the same system:
flameshot guistarted from a plain shell always fails with "Unable to capture screen" because the GNOME screenshot portal refuses the request; started throughsystemd-run --user --scope -- flameshot gui(the way gsd-media-keys launches it) it works. Happy to open that separately if useful.
Screenshots
(none — the numbers above come from --print-geometry, which is more precise than a screenshot)
Source: flameshot-org/flameshot