Commit d0779aa
fix: handle display rotation in wallpaper rendering
Implement the `transform_changed` handler (previously a TODO stub) to
properly track output transform changes. When a display is rotated 90°
or 270°, the wallpaper dimensions need to be swapped so the image is
scaled to the correct orientation.
Changes:
- Add `transform` field to `CosmicBgLayer` to track output orientation
- Add `effective_size()` method that swaps width/height for rotated displays
- Implement `transform_changed()` to update transform and trigger redraw
- Use `effective_size()` instead of raw `size` when calculating wallpaper
dimensions in the draw path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 808a50e commit d0779aa
2 files changed
+48
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
86 | 111 | | |
87 | 112 | | |
88 | 113 | | |
| |||
356 | 381 | | |
357 | 382 | | |
358 | 383 | | |
| 384 | + | |
359 | 385 | | |
360 | 386 | | |
361 | 387 | | |
| |||
401 | 427 | | |
402 | 428 | | |
403 | 429 | | |
404 | | - | |
405 | | - | |
| 430 | + | |
| 431 | + | |
406 | 432 | | |
407 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
408 | 452 | | |
409 | 453 | | |
410 | 454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| |||
0 commit comments