Commit 8d8a4c9
authored
Fix multi monitor offset bug in Qt6 multi-monitor setups for X11 (flameshot-org#4127)
* Fix dual monitor offset bug in Qt6 multi-monitor setups
The issue was caused by using QApplication::primaryScreen() to capture
the entire desktop, but in Qt6 the primary screen is not necessarily
the leftmost screen. This caused coordinate system misalignment in
multi-monitor setups where the primary screen is positioned to the right.
Additionally, the previous approach failed in edge cases where screens
have different heights and the desktop bounding box includes virtual
space that doesn't correspond to any physical screen.
Changes:
- Replace single-screen desktop capture with composite approach
- Capture each screen individually and composite them together
- Position capture widget to cover entire desktop geometry
- Remove devicePixelRatio division that caused coordinate issues
- Handle virtual desktop space by filling with black background
This solution works with any multi-monitor configuration including:
- Primary screen not being leftmost
- Screens with different resolutions and alignments
- Bottom-aligned or top-aligned screen arrangements
- Complex layouts with virtual coordinate space
Fixes flameshot-org#4111
* Fix clang-format issue
---------
Co-authored-by: ionsquare <[email protected]>1 parent 8006d79 commit 8d8a4c9
2 files changed
+32
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
213 | 232 | | |
214 | 233 | | |
215 | 234 | | |
| |||
259 | 278 | | |
260 | 279 | | |
261 | 280 | | |
262 | | - | |
263 | | - | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
264 | 284 | | |
265 | 285 | | |
266 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
159 | 163 | | |
160 | 164 | | |
161 | 165 | | |
| |||
0 commit comments