Implement working screenshot capture with wlr-screencopy

- Fixed brace mismatch and duplicate code in screenshot.rs
- Increased SHM pool size to 256MB for high-res displays
- Corrected wlr-screencopy protocol usage: send copy request in Buffer event
- Fixed background handling: set_background now updates LockedSurface.background
- Removed dummy background creation; screenshots set when ready
- Added format conversion for Xbgr8888 and Xrgb8888 to ARGB32
- Proper Y-inversion handling based on flags

The lock screen now displays captured screenshots as background.
Screenshots are taken immediately after lock, before UI is shown.
Matches swaylock-effects behavior: lock appears first, then screenshot
applies when ready (no blocking).

Fixes: black/red screen issues, screenshot not displaying.
This commit is contained in:
2026-03-06 21:21:47 +01:00
parent bd6f1df391
commit 8aa84209a8
5 changed files with 660 additions and 113 deletions
+3
View File
@@ -7,6 +7,9 @@ edition = "2021"
smithay-client-toolkit = { version = "0.19", features = ["calloop"] }
wayland-client = "0.31"
wayland-protocols = { version = "0.32", features = ["client", "unstable"] }
wayland-protocols-wlr = { version = "0.3", features = ["client"] }
anyhow = "1.0"
futures = "0.3"
cairo-rs = { version = "0.20", features = ["png"] }
image = "0.25"
fastblur = "0.1"