Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge upstream #86

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open

Merge upstream #86

wants to merge 24 commits into from

Conversation

David96
Copy link

@David96 David96 commented Feb 10, 2022

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

emersion and others added 23 commits February 17, 2021 16:50
mako does something similar.
Initializing to 1 is incorrect when the surface scale is > 1.
We incorrectly used the buffer size instead of the surface size.
Let's not bother and just damage the maximum region.
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
An odd value of fe.height lead to the indicator disappearing. This was
due to the buffer size no longer being a multiple of the buffer scale.
This commit fixes the issue by checking both height and width to be a
multiple of scale.

This is done early to avoid excessive re-calls of create_buffer if the
buffer_height != new_height in render.c line 314 (now 318).
The next commit will need that version. Adjust the build to not
trigger deprecation warnings.
This allows building swaylock with a local wayland-protocols.
This is a new protocol to lock the session [1]. It should be more
reliable than layer-shell + input-inhibitor.

[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/131
More consistent with our code style.
We don't actually require xdg-shell support.
@mozartilize
Copy link

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
Copy link
Author

David96 commented May 25, 2022

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
Copy link

@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
Copy link
Author

David96 commented May 25, 2022

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
Copy link
Author

David96 commented May 25, 2022

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.

jirutka added a commit to jirutka/swaylock-effects that referenced this pull request Jun 22, 2022
@jirutka jirutka mentioned this pull request Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants