Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exiting sway puts computer to sleep if laptop lid is closed #7269

Closed
Davester47 opened this issue Nov 16, 2022 · 6 comments
Closed

Exiting sway puts computer to sleep if laptop lid is closed #7269

Davester47 opened this issue Nov 16, 2022 · 6 comments
Labels
bug Not working as intended

Comments

@Davester47
Copy link

Please fill out the following:

  • Sway Version:
    • swaymsg -t get_version or sway -v

I used the latest git.
sway version 1.8-dev-76232927 (Nov 16 2022, branch 'master')

  • Debug Log:
    • Run sway -d 2> ~/sway.log from a TTY and upload it to a pastebin, such as gist.github.com.
    • This will record information about sway's activity. Please try to keep the reproduction as brief as possible and exit sway.
    • Attach the full file, do not truncate it.

https://gist.github.com/Davester47/33e6ba6e5bd189592d764530c8b12c27

These messages also appeared in the tty after closing sway.

[ 6344.785452] i915 0000:00:02.0: [drm] *ERROR* Failed to write source OUI
[ 6347.886252] i915 0000:00:02.0: [drm] *ERROR* Failed to write source OUI
  • Configuration File:
    • Please try to produce with the default configuration.
    • If you cannot reproduce with the default configuration, please try to find the minimal configuration to reproduce.
    • Upload the config to a pastebin such as gist.github.com.

I used the default.

  • Description:
    • The steps you took in plain English to reproduce the problem.

I noticed this issue because I use an external monitor and keep my laptop closed most of the time. Exiting sway with the lid closed puts the computer to sleep, but it exits to the tty like normal if the lid is open.

  1. Start sway
  2. Close laptop lid
  3. Press start+shift+e to pull up the exit menu
  4. Exit
  5. Computer goes to sleep

After waking it from sleep, the computer goes to the tty like normal except for the error messages from dmesg I included above.

@Davester47 Davester47 added the bug Not working as intended label Nov 16, 2022
@emersion
Copy link
Member

This is probably systemd's doing.

@Davester47
Copy link
Author

Not sure if this helps or not, but exiting other wayland desktops like Plasma don't put the computer to sleep, they just go back to the tty.

@smlx
Copy link
Contributor

smlx commented Nov 17, 2022

I think @emersion is correct: this is controlled in /etc/systemd/logind.conf. I suspect you can get whatever behaviour you need by setting HandleLidSwitch= to the desired value. Probably ignore.

I also see this behaviour but consider it a feature because why would I not want my laptop to suspend if its only input and display are inaccessible due to laptop being closed?

@emersion
Copy link
Member

@Davester47
Copy link
Author

I think @emersion is correct: this is controlled in /etc/systemd/logind.conf. I suspect you can get whatever behaviour you need by setting HandleLidSwitch= to the desired value. Probably ignore.

Thanks, setting it to ignore fixed my issue. It is still a little annoying though that KDE didn't need this to keep from going to sleep.

I also see this behaviour but consider it a feature because why would I not want my laptop to suspend if its only input and display are inaccessible due to laptop being closed?

I guess I forgot to mention this in the initial post, but I keep my laptop lid closed all the time, and I have it hooked up to an external keyboard, monitor, and mouse. It has other inputs, which was why this was frustrating.

@emersion
Copy link
Member

emersion commented Feb 1, 2023

Closing, please follow the wlroots issue linked above if you're interested in not turning outputs off on exit.

@emersion emersion closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

3 participants