labwc icon indicating copy to clipboard operation
labwc copied to clipboard

Locked screen issues (black flash, cursor showing not hidden/disabled) both with swaylock and waylock

Open charbelnicolas opened this issue 2 years ago • 8 comments

I've been comparing hyprland and river against labwc for the last couple of months and I've noticed some differences when locking a session. I think hyprland and river are both doing it a bit better than labwc in this regard and I hope that labwc can improve upon this.

Issue number one:

When locking a session, both hyprland and river (with either waylock or swaylock) will switch to the lock screen immediately without flashing a black frame before setting whatever color you've chosen on said lock screen. For example, if your background is set to pure white and your lock screen is set to a blue color it will go directly from white to blue. In labwc, it will go from white to a black screen and then to blue (a quick black frame flash). I know It's a very small nuissance but it should not be there IMO.

Issue number two:

Also, both hyprland and river will disable and hide the cursor as soon as the session is locked but labwc keeps the cursor enabled and visible. I read a little bit about the wayland specification for the session locking and I think it was mostly left up to the compositor to decide to hide or not hide the cursor. I think the cursor is unnecessary and can sometimes be misleading since you won't notice that you've locked your session if you happen to have the same background color as the locked screen color (just as I have it set up -_-).

Sorry if this is too picky but I want labwc to be the best it can be and it is now my daily driver and it actually allowed me to get rid of awesome wm at last :)

charbelnicolas avatar Jan 20 '24 00:01 charbelnicolas

Thanks for reporting. These are not too picky at all. We care about getting these sort of details right.

  1. Not sure about the first one, but sounds like we are doing something wrong. Will investigate.

  2. We used to hide the cursor on swaylock launch. I had noticed this regression and do have a patch. The reason I haven’t pushed it yet was that the cursor doesn’t come back on cursor-movement which I expected it to. Do you know if it does on hyprland and river?

johanmalm avatar Jan 21 '24 21:01 johanmalm

Thanks for reporting. These are not too picky at all. We care about getting these sort of details right.

  1. Not sure about the first one, but sounds like we are doing something wrong. Will investigate.
  2. We used to hide the cursor on swaylock launch. I had noticed this regression and do have a patch. The reason I haven’t pushed it yet was that the cursor doesn’t come back on cursor-movement which I expected it to. Do you know if it does on hyprland and river?

Thanks for taking the time to respond @johanmalm, here's a bit more info:

Edit Update: Never mind about what I typed earlier on issue 1, the black frame flash seems to happen everytime the screen gets locked.

For Issue 2, both hyprland and river hide the cursor completely when locking the session and it only becomes visible again when unlocking the session (I think this is because neither swaylock or waylock have a visible text field to select and type a password or username like other distros/compositors.

If you use sawybg with a #ffffff background and use swaylock or waylock with a blue or another light background when the session is locked you can see the black flash easily.

charbelnicolas avatar Jan 21 '24 22:01 charbelnicolas

To be honest with you, now that I'm trying to replicate issue number 1 sometimes I don't see the black flash so I'm not that certain anymore of what might be causing it...

charbelnicolas avatar Jan 21 '24 22:01 charbelnicolas

Here is a small video showing the "black" flash... Not exactly a black frame but it darkens the frame.... it's kind of weird....

https://github.com/labwc/labwc/assets/14960414/2d925892-e1ee-464c-bc7e-3a68553794e7

charbelnicolas avatar Jan 22 '24 00:01 charbelnicolas

Sorry about the spam, surprisingly wf-recorder works while have the session locked so I was able to record everything.

This is locking the session with labwc (note the brief black frame flash):

https://github.com/labwc/labwc/assets/14960414/5eafc755-bf5e-48a8-9c48-994a2d2e7192

And here is locking the session with river:

https://github.com/labwc/labwc/assets/14960414/d4fbe860-7e37-451d-8818-bb71e594a5ea

charbelnicolas avatar Jan 22 '24 00:01 charbelnicolas

Last one, I promise. This shows frame by frame when editing in blender, there is exactly one black frame in between the moment the session is still unlocked and when the session is locked.

https://github.com/labwc/labwc/assets/14960414/b585edc4-df5f-4f72-9db7-7bffb89c3fce

charbelnicolas avatar Jan 22 '24 01:01 charbelnicolas

Maybe it's related to this?

ss_2024_01_22_17_57_20

ss_2024_01_22_18_00_10

charbelnicolas avatar Jan 22 '24 23:01 charbelnicolas

I skimmed the spec and it says:

The compositor may wait for the client to create and render session lock surfaces before sending the locked event to avoid displaying intermediate blank frames. However, it must impose a reasonable time limit if waiting and send the locked event as soon as the hard requirements described above can be met if the time limit expires. Clients should immediately create lock surfaces for all outputs on creation of this object to make this possible.

So we can make use of timer and display the blank frame only if the client doesn't offer the surface before the timeout.

tokyo4j avatar Apr 28 '24 08:04 tokyo4j

Do we want to get this into 0.7.2 or delay to the next release cycle? CC @johanmalm @ahesford @tokyo4j @jlindgren90

Consolatis avatar May 03 '24 11:05 Consolatis

Getting locking wrong is kind of a big deal. The timer-based fix seems simple enough, but if it's rushed for the next release and there are unanticipated bugs, we could break locking. This seems worse than living with some visual glitches for another cycle.

ahesford avatar May 03 '24 12:05 ahesford

Yes, I tend to agree.

Edit: Based on the feedback I moved this to the 0.7.3 milestone.

Consolatis avatar May 03 '24 12:05 Consolatis