Commit Graph

14 Commits

Author SHA1 Message Date
jory 5b3377a15b Added grace implementation 2026-03-07 22:06:22 +01:00
jory 88f7833d8d First working version with all options except grace 2026-03-07 21:48:24 +01:00
jory 7cdcf19415 Add diagnostic logging to troubleshoot screenshot display issue 2026-03-06 22:08:38 +01:00
jory 3637accaa6 Delay lock UI rendering until screenshots are captured
- Add pending_screenshots counter to WaylandLock
- Set pending_screenshots = output_count in locked() if screenshots enabled
- Timer skips rendering while pending_screenshots > 0
- Decrement pending_screenshots on Ready or Failed events
- When all screenshots done, timer starts rendering
- This ensures screenshots capture the desktop, not the lock UI

Fixes grey screenshot issue caused by capturing lock surface itself.
Matches swaylock-effects behavior: wait for screenshots before initial render.
2026-03-06 21:56:36 +01:00
jory 5fe331122e Add comprehensive debug logging for screenshot rendering
- Timer callback: log each tick and commit status
- LockedSurface::update(): log background presence, fade alpha, feedback states
- Renderer::render(): log background drawing and fade alpha
- Ready event: log background set confirmation

These logs will help diagnose why screenshots are not displaying.
2026-03-06 21:41:15 +01:00
jory 1426b2d2d0 Fix screenshot byte order conversion (critical bug)
The conversion functions were producing big-endian ARGB (A,R,G,B) but
Cairo's ARGB32 on little-endian systems expects B,G,R,A byte order.
This caused screenshots to appear completely corrupted (likely black or
solid color).

Fixed both convert_xbgr8888_to_argb32 and convert_xrgb8888_to_argb32:
- Xbgr8888: source [R,G,B,X] -> dest [B,G,R,A=255]
- Xrgb8888: source [B,G,R,X] -> dest [B,G,R,A=255]

Added detailed comments explaining memory layouts and conversion logic
to prevent future regressions.

This should make screenshots display correctly.
2026-03-06 21:30:05 +01:00
jory 8aa84209a8 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.
2026-03-06 21:21:47 +01:00
jory bd6f1df391 Apply suggestions by rust 2026-03-05 15:02:45 +01:00
jory e440a86d97 Made sure we can actually render UI elements 2026-03-05 14:50:59 +01:00
jory 09b9a531cc Apply suggestions by rust 2026-03-05 14:20:45 +01:00
jory 76b48f7c70 First propper working version with actual pam 2026-03-05 14:19:08 +01:00
jory 4ed70fd858 First kinda working version 2026-03-05 12:40:53 +01:00
jory 9daa2fdd8f Removed control+c behaviour and updated keyboard handler and pam auth 2026-03-05 11:55:29 +01:00
jory a33488adc6 Initial commit of an attempt of making my own wayland locker like swaylock 2026-03-05 10:45:41 +01:00