I'm having this issue since I enabled Wayland, which was necessary to make my laptop work properly when using dual monitor. The issue consists on when I boot Ubuntu, the login screen appears on the external monitor, which isn't really a problem if I'm with the dual monitor setup. The thing is that my PC is a laptop and even when there isn't an external monitor connected, the login screen doesn't appear in my laptop. Actually, when this happen, my PC completely freezes with the Ubuntu loading window displayed and, in order to login, I have to connect an HDMI cable so then the login process continues and I can input my password.
I'm using Ubuntu 24.04 with gnome and wayland. My PC has an integrated Intel GPU and a Nvidia dGPU.
I'm writing this because I have tried a lot of different things that I saw in different forums but didn't manage to make it work properly. Also, the issues that I read were, for Ubuntu 22 and older, and I don't know if there could be a difference.
I tried to copy the monitors.xml file from ~/.config/ to /var/lib/gdm3/ and didn't work. I also tried deleting the monitors config file, configuring correctly the displays and creating it again and neither. Also tried to manually write in the monitors.xml file 'yes' for the internal display and 'no' for the external one, and even deleting the fields corresponding to the external monitor to just have configured one monitor as my primary one and neither.
I also tried writing the following:
Section "Monitor"
Identifier "eDP-1"
Option "Primary" "true"
EndSection
in a file: /etc/X11/xorg.conf.d/10-primary-display.conf which solved the problem for a while but then it started happening again.
I would appreciate any kind of help. I'm pretty new with the Linux ecosystem, so for me it's sometimes a little bit messy to make things work.
Thank you in advance!