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

Main laptop monitor disabled after closing lid #996

Open
ViddeM opened this issue Jan 17, 2025 · 15 comments
Open

Main laptop monitor disabled after closing lid #996

ViddeM opened this issue Jan 17, 2025 · 15 comments
Labels
bug Something isn't working

Comments

@ViddeM
Copy link

ViddeM commented Jan 17, 2025

When I close the lid of my laptop and then open it up again, niri won't start up. After switching to another tty and back I can (after a while) get back to the login screen (GDM3) but when I log in the main monitor is just blank.

Even more strange, if I plug in (or re-plug in case I already had one plugged in) an external monitor that one usually starts working and if I then remove the cable, my main screen starts working again but if I once again plugin the external monitor the laptop screen gets disabled. (I basically get an xor between my external monitor and my laptop screen).

When running niri msg outputs it lists "Disabled" under my main laptop monitor output when the external monitor is plugged in.

I considered adding my notes to issue #837 as it sounds similar but as it is not quite the same I decided to create my own.

System Information

  • niri version: 0.1.10-1 (self-compiled from commit 75c7911, tag v0.1.10.1)
  • Distro: Ubuntu 24.04.1 LTS
  • GPU: NVIDIA RTX A2000 Mobile
  • CPU: 11th Gen Intel i7-11850H (16) @ 4.800GHz

(Laptop: HP ZBook Fury 15.6 inch G8 Mobile Workstation PC)

Sidenote: Thanks for building this otherwise amazing piece of software 🥇

@ViddeM ViddeM added the bug Something isn't working label Jan 17, 2025
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 17, 2025

Hmm, could you post journalctl --user-unit=niri -b when reproducing the issue? Let's see if there's anything weird regarding libinput lid events.

Also try if keep-laptop-panel-on-when-lid-is-closed fixes it for you.

@ViddeM
Copy link
Author

ViddeM commented Jan 17, 2025

Was just about to add that 😅

It's a work laptop so I had to censor my username and hostname but here is the log. It seems to spam "device is inactive" after closing/reopening the lid.

niri_error_log.txt

I'll try that one! :)

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 17, 2025

Huh, this is strange. Could you by chance try cosmic-comp or anvil to see if they suspend/unsuspend properly?

@ViddeM
Copy link
Author

ViddeM commented Jan 17, 2025

I added the keep-laptop-panel... option to my config and my main monitor instantly turned on. I tried closing the lid and opened it up again and after a while (say 1-2 minutes) it opened up a very borked version of my swaylock config. Things seem to be working but my swaybg seems to have given up and several of my windows look a bit weird.

@ViddeM
Copy link
Author

ViddeM commented Jan 17, 2025

Huh, this is strange. Could you by chance try cosmic-comp or anvil to see if they suspend/unsuspend properly?

Never heard of either 😅
I'm guessing it's this one? https://github.com/pop-os/cosmic-comp

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 17, 2025

Yeah. And anvil is https://github.com/Smithay/smithay/tree/master/anvil

@ViddeM
Copy link
Author

ViddeM commented Jan 17, 2025

I'll take a look and get back to you! (Thanks for the quick replies btw!)

@ViddeM
Copy link
Author

ViddeM commented Jan 17, 2025

I got a bit distracted (gotta get some work done too 😅). I'm not too familiar with the relation between WMs and Compositors, should I try installing / running cosmic-comp together with Niri (if so how?) or that I should run the entire cosmic WM?

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 17, 2025

On Wayland the compositor and the WM are one and the same. You can run cosmic-comp on a TTY, open some window there (not sure what their default binds are), then try to suspend/unsuspend and see if you can reproduce the issue. Or you could install and run the entire cosmic if that's easier.

@ViddeM
Copy link
Author

ViddeM commented Jan 17, 2025

So, I sort of got cosmic-comp to work (didn't really find any installation instructions).

However, there I just ended up directly on the GDM3 login screen after opening the lid and all monitors were active after logging in again.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 17, 2025

Hm. And this was the same session, as in it didn't just crash upon opening the lid?

@ViddeM
Copy link
Author

ViddeM commented Jan 18, 2025

I tried to do some more testing to confirm weather it was or wasn't but now it doesn't work at all, my waybar doesn't load and the mouse won't move. Seems like it breaks quite badly. I also tried anvil and that too seemed to break completely when closing the lid. :/

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 18, 2025

I also tried anvil and that too seemed to break completely when closing the lid

Hmm, might be a Smithay issue then. Really not sure. Do other compositors work fine? Like GNOME or KDE or sway.

@ViddeM
Copy link
Author

ViddeM commented Jan 18, 2025

Gnome has worked great for x11 and mostly in wayland mode, I have noticed some windows looking a little bit weird at times after sleep mode but moving them around usually solved that.

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 19, 2025

If it reproduces on anvil (or better on cosmic), it's probably better to open an issue on Smithay or on cosmic-comp. They have much more experience (and funding) dealing with strange problems like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants