swaywm / swaylock

Screen locker for Wayland
MIT License
851 stars 202 forks source link

swaylock and/or swayidle blocks laptop from responding after sleep #217

Open xyproto opened 3 years ago

xyproto commented 3 years ago

This might be a duplicate issue, I'm not sure. I searched through similar issues before submitting.

Steps to reproduce:

Lines mentioning swaylock from the Sway config:

exec swayidle -w timeout 900 'swaylock -f -c 5ca389ff' timeout 1200 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -f -c 5ca389ff'
bindsym $super+l exec /usr/bin/swaylock -f -c 5ca3889ff
fardog commented 2 years ago

I'm having this issue also on the latest version of sway, swaylock, swayidle; it also happened with waylock (but otherwise identical) which makes me think it's something in sway + wayland, or swayidle. killing the locker from another tty seems to get it working again, although leaves many windows in an unusual state, and they often need to be killed before things start working again.

The issue appears to be that the locker can't receive input after waking up from sleep. It came in with my latest set of updates, but I haven't had a chance to bisect the changes yet to see what the issue came in with (especially since it's happening on my work computer, and I've been just working around it to get back to work). I'm going to look into it more, but wanted to comment that: you're not alone!

fardog commented 2 years ago

@xyproto so bisecting my packages didn't reveal anything meaningful, but I wasn't able to do a full revert of everything. I found something unexpected: at the same time I upgraded, i also switched from Chrome (well, Chromium) to Firefox. it didn't seem likely that would be the issue, but i decided to test it out and move back to chromium, and all of my problems went away. this is surprising enough that i feel like it's a fluke, and i'll probably try firefox again to see if the issue comes back after i ensure this fixes it, but i'm wondering: do you use Firefox?

i was running it with the following env vars:

MOZ_ENABLE_WAYLAND=1
MOZ_WEBRENDER=1
xyproto commented 2 years ago

@fardog That's interesting!

Yes, I also use Firefox. I usually have both Firefox and Chromium running, to easily separate my work and personal accounts.

I can double check, but I believe I also have MOZ_ENABLE_WAYLAND=1 set.

xyproto commented 2 years ago

@fardog I just checked, and I don't have MOZ_ENABLE_WAYLAND or MOZ_WEBRENDER set, but I do have MOZ_DBUS_REMOTE=1 set, to make xdg-open work with Wayland + Firefox (I'm not sure if it's needed any more).

fardog commented 2 years ago

@xyproto interesting. fwiw i think xdg-open worked fine for me without that, so yeah it might not be needed. things have been 100% stable for me over the last two days after switching back to Chromium. i think on monday maybe i'll try firefox again and see if all my problems return.

fardog commented 2 years ago

@xyproto got busy at work but finally changed back to firefox a few days ago, and haven't had any issues yet, but it's still a bit too early for me to call it "good". I've otherwise changed no settings. the unfortunate thing is that i didn't capture my various software versions when it was having issues, and i'm sure some of these packages (at least firefox) have been updated since my initial issues. capturing it here now though.

environment:

GTK_THEME=Adwaita-dark
CLUTTER_BACKEND=wayland
XDG_SESSION_TYPE=wayland
XDG_CURRENT_DESKTOP=sway
QT_QPA_PLATFORM=wayland
QT_WAYLAND_FORCE_DPI=physical
QT_WAYLAND_DISABLE_WINDOWDECORATION=1
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_SCALE_FACTOR=1
SDL_VIDEODRIVER=wayland
_JAVA_AWT_WM_NONREPARENTING=1
MOZ_ENABLE_WAYLAND=1
MOZ_WEBRENDER=1 

versions:

sway==1.7
swayidle==1.7.1
swaylock=1.5
firefox==96.0.3

anyhow now that i'm moved back over, i'll update here if i experience the issue again.