swaylock icon indicating copy to clipboard operation
swaylock copied to clipboard

Race condition when an output is plugged in

Open emersion opened this issue 6 years ago • 4 comments

  1. Have a window with sensitive information
  2. Run swaylock
  3. Unplug the output so that sway runs without any output
  4. Re-plug the output
  5. sway draws the window with sensitive information
  6. swaylock notices a new output has appeared, creates a new surface and draws
  7. 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.

emersion avatar Jan 16 '19 21:01 emersion

When binding lid switch to disable internal output on a laptop, this ends up happening pretty much every time the laptop is opened.

kennylevinsen avatar Mar 30 '19 22:03 kennylevinsen

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.

davidedmundson avatar Aug 20 '20 15:08 davidedmundson

Is there a workaround to this problem other than not disabling the output when the laptop lid is closed?

luispabon avatar Aug 03 '21 08:08 luispabon

The intented fix for this is https://github.com/swaywm/wlr-protocols/pull/86. Needs implementations.

emersion avatar Aug 03 '21 08:08 emersion

The protocol has been implemented now.

emersion avatar Dec 14 '23 10:12 emersion