mortie / swaylock-effects

Swaylock, with fancy effects
MIT License
698 stars 44 forks source link

Merge upstream #86

Open David96 opened 2 years ago

David96 commented 2 years ago

The main change is the added support for ext-session-lock-v1 I think.

mozartilize commented 2 years ago

I think it needs some work to support ext-session-lock-v1. Did you test the PR? On my try, the lock crashes and only session lock remains.

David96 commented 2 years ago

I did test it and for me it worked but as far as I remember with river not sway, might very well be that I missed something.

Edit: still works for me with sway, debug output:

2022-05-25 12:14:49 - [main.c:1824] Found config at /home/user/.config/swaylock/config
2022-05-25 12:14:49 - [main.c:1720] Config Line #1: indicator-radius=90
2022-05-25 12:14:49 - [main.c:1720] Config Line #2: indicator-thickness=20
2022-05-25 12:14:49 - [main.c:1720] Config Line #3: indicator-caps-lock
2022-05-25 12:14:49 - [main.c:1720] Config Line #5: color=000000
2022-05-25 12:14:49 - [main.c:1720] Config Line #8: screenshots
2022-05-25 12:14:49 - [main.c:1720] Config Line #9: effect-blur=7x5
2022-05-25 12:14:49 - [main.c:1720] Config Line #10: effect-vignette=0.5:0.5
2022-05-25 12:14:49 - [main.c:1834] Parsing CLI Args
2022-05-25 12:14:49 - [main.c:1881] Using ext-session-lock-v1
2022-05-25 12:14:49 - [main.c:314] Creating surface
2022-05-25 12:14:49 - [main.c:318] Adding lock surface listener
2022-05-25 12:14:49 - [main.c:314] Creating surface
2022-05-25 12:14:49 - [main.c:318] Adding lock surface listener
2022-05-25 12:14:49 - [main.c:688] output name is DP-1
2022-05-25 12:14:49 - [main.c:396] Configuring lock surface
2022-05-25 12:14:49 - [main.c:688] output name is eDP-1
2022-05-25 12:14:49 - [main.c:396] Configuring lock surface
2022-05-25 12:14:49 - [main.c:650] Loaded screenshot for output eDP-1
2022-05-25 12:14:49 - [main.c:346] Surface for output eDP-1 ready
2022-05-25 12:14:50 - [main.c:650] Loaded screenshot for output DP-1
2022-05-25 12:14:50 - [main.c:346] Surface for output DP-1 ready

Edit2: I think the screenshot plugin is broken though since the effects are applied after the lock was acquired. The order would have to be switched here to make it work again.

mozartilize commented 2 years ago

@David96 did you run on latest sway master? this is what I got running your branch

$ build/swaylock --screenshots --clock --timestr %H:%M --indicator --indicator-thickness 5 --effect-blur 8x5 --fade-in .35 -d
2022-05-25 19:20:19 - [main.c:1831] Parsing CLI Args
2022-05-25 19:20:19 - [main.c:1878] Using ext-session-lock-v1
2022-05-25 19:20:19 - [main.c:685] output name is DP-1
2022-05-25 19:20:19 - [main.c:647] Loaded screenshot for output DP-1
2022-05-25 19:20:19 - [main.c:344] Surface for output DP-1 ready
[1]    3901 segmentation fault (core dumped)  build/swaylock --screenshots --clock --timestr %H:%M --indicator  5  8x5  .35

I tried to merge upstream yesterday but I got the error like ext_session_lock_surface not configured. I think currently swaylock-effects only uses xdg_output's surface, not ext_session_lock's surface

David96 commented 2 years ago

Yeah the issue seems to be the fade-in plugin, when removing that from the command line everything works for me. I guess setting alpha on a lock surface doesn't make any sense since the protocol makes sure that as soon as the lock is acquired the compositor doesn't composite anything else. In the end this is a similar issue to the screenshot plugin, it might be needed to give plugins some way of telling us when they are ready for the lock to be acquired.

David96 commented 2 years ago

Ok, the fade thing was an actual merge mistake that should be fixed now. Still the fade in won't work properly due to the nature of the sessionlock protocol but at least it shouldn't crash anymore.