dwl icon indicating copy to clipboard operation
dwl copied to clipboard

implement ext-session-lock-v1

Open sevz17 opened this issue 2 years ago • 2 comments

Implement ext-session-lock which is merged in wayland-protocols

Currently, our security policy is to allow creating new screenlockers if the previous one dies, but if the previous screenlocker dies and no new screenlocker is started, dwl will stay locked.

PS. I don't like this implementation, but wlroots' one requires us to unlink all our handlers.

sevz17 avatar Apr 09 '22 04:04 sevz17

Would this obviate the use-case for input-inhibit?

djpohly avatar Apr 11 '22 16:04 djpohly

I think so, this is within wayland-protocols, while input-inhibit is a wlroots-protocol, however input-inhibit only added like 4 lines

sevz17 avatar Apr 13 '22 03:04 sevz17

@fauxmight, when you upgrade to wlroots-0.16 can you try this?, I'm interested in plug/unplug and enable/disable monitors.

sevz17 avatar Nov 12 '22 03:11 sevz17

@fauxmight, when you upgrade to wlroots-0.16 can you try this?, I'm interested in plug/unplug and enable/disable monitors.

I will. I am lazily waiting for Arch to push 0.16, but I have been following here.

fauxmight avatar Nov 16 '22 13:11 fauxmight

I don't have any difference with multi-monitor connect/disconnect with or without the "ext-session-lock-v1" branch merged:

(Starting with two monitors connected and active): When one monitor is disconnected, clients are moved (correctly) to the remaining, connected monitor.

When the second monitor is disconnected [wait 10 seconds] and reconnected,

  • no segfault happens immediately (as it did with 0.15x)
  • no mouse/keyboard interaction with any client seems possible
  • attempting to MOVE a client window results in a dwl segfault

fauxmight avatar Nov 22 '22 18:11 fauxmight

  • attempting to MOVE a client window results in a dwl segfault

Can you describe the steps to reproduce the segfault?

sevz17 avatar Nov 22 '22 20:11 sevz17

Thanks for today's updates (2022-12-01). This makes testing a bit easier.

Environment includes

export MOZ_ENABLE_WAYLAND=1
export GDK_BACKEND=wayland

Testing with the following clients: alacritty and firefox and (layer shell) waybar

Start dwl with two active monitors Start alacritty on monitor1 Start firefox on monitor2 Disconnect monitor2 with KVM switch [At this point client on monitor2 is moved to monitor1 retaining its tags and all continues working/behaving correctly.] Power-off monitor1 [Now, no active monitor remains] Wait 10 seconds Reconnect monitor2 with KVM switch At this point with all monitors in tile mode, alacritty is resized to fill an entire monitor no longer honoring the layer shell client space. If alacritty is set transparent beforehand, waybar and firefox still show through the transparent alacritty from underneath (demonstrating that neither waybar nor firefox has not been killed in the monitor disconnects/reconnects).

Attempting to change tags on alacritty causes dwl to die. Attempting to move alacritty by mouse causes dwl to die.

Log shows the following:

amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
Gdk-Message: 13:15:54.945: Error reading events from display: Broken pipe
Error: "Event loop terminated with code: 1"
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.

EDIT:

  1. Will try with something other than alacritty to make sure it is not specific to alacritty.
  2. Considering the log above, this may be an issue specific to AMD GPU.

fauxmight avatar Dec 01 '22 19:12 fauxmight

I don't have any difference with multi-monitor connect/disconnect with or without the "ext-session-lock-v1" branch merged:

Ah, I missed this one, I guess I can merge this and fix the crash in main, right?

sevz17 avatar Dec 02 '22 04:12 sevz17

Thanks for today's updates (2022-12-01). This makes testing a bit easier.

Environment includes

export MOZ_ENABLE_WAYLAND=1
export GDK_BACKEND=wayland

Testing with the following clients: alacritty and firefox and (layer shell) waybar

Start dwl with two active monitors Start alacritty on monitor1 Start firefox on monitor2 Disconnect monitor2 with KVM switch [At this point client on monitor2 is moved to monitor1 retaining its tags and all continues working/behaving correctly.] Power-off monitor1 [Now, no active monitor remains] Wait 10 seconds Reconnect monitor2 with KVM switch At this point with all monitors in tile mode, alacritty is resized to fill an entire monitor no longer honoring the layer shell client space. If alacritty is set transparent beforehand, waybar and firefox still show through the transparent alacritty from underneath (demonstrating that neither waybar nor firefox has not been killed in the monitor disconnects/reconnects).

Attempting to change tags on alacritty causes dwl to die. Attempting to move alacritty by mouse causes dwl to die.

Log shows the following:

amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
Gdk-Message: 13:15:54.945: Error reading events from display: Broken pipe
Error: "Event loop terminated with code: 1"
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.

Can you send me the backtrace?

1. Will try with something other than alacritty to make sure it is not specific to alacritty.

Thanks!

2. Considering the log above, this may be an issue specific to AMD GPU.

From a time ago I started to see this amdgpu: amdgpu_cs_ctx_create2 failed. (-13) when starting dwl/sway, but I haven't experienced issues related to it (but I run a single-monitor setup, things may change)

sevz17 avatar Dec 02 '22 04:12 sevz17

@fauxmight?

sevz17 avatar Dec 06 '22 04:12 sevz17

Will test EDIT ~soon~ within two days. Apologies for the delay.

fauxmight avatar Dec 06 '22 05:12 fauxmight

Will test EDIT ~soon~ within two days. Apologies for the delay.

Ok, no rush, thank you for helping me to test

sevz17 avatar Dec 06 '22 05:12 sevz17

I don't have any difference with multi-monitor connect/disconnect with or without the "ext-session-lock-v1" branch merged:

Ah, I missed this one, I guess I can merge this and fix the crash in main, right?

I cannot EDIT ~see~ reproduce the crash in main that this fixes, but this still makes no problems for me with single- or dual-monitor. As far as I can tell, this is good to merge.

fauxmight avatar Dec 06 '22 05:12 fauxmight

Thank you, @sevz17 for the amazing quantity of work you have put into dwl, especially in recent days.

fauxmight avatar Dec 06 '22 05:12 fauxmight