swaylock
swaylock copied to clipboard
Race condition when an output is plugged in
- Have a window with sensitive information
- Run swaylock
- Unplug the output so that sway runs without any output
- Re-plug the output
- sway draws the window with sensitive information
- swaylock notices a new output has appeared, creates a new surface and draws
- sway draws swaylock, occluding the sensitive data
(5) may or may not be visible during a long time, depending on various conditions. Recording the screen with a camera might allow to retrieve the screen contents.
When binding lid switch to disable internal output on a laptop, this ends up happening pretty much every time the laptop is opened.
FWIW, within kwin we know when a screen is locked (we have something bespoke, but you can get it from the logind hint)
When locked we don't render anything at all except for windows from a specific client. For you that could be only showing windows with a given namespace.
We still have the race where we render before our lockscreen catches up, but because we're skipping all other windows, that just results in a black screen for a bit, which isn't a problem.
Is there a workaround to this problem other than not disabling the output when the laptop lid is closed?
The intented fix for this is https://github.com/swaywm/wlr-protocols/pull/86. Needs implementations.
The protocol has been implemented now.