I am using Ubuntu 22.04.3 on an LG gram 2-in-1 laptop. According to the settings, my GNOME version is 42.9 and my windowing system is X11. I have only one monitor and have never had any extra monitors or displays of any kind.
The login screen never gave me problems before, but ever since about a month ago, it started automatically logging me in after I boot my computer a few seconds after I've started typing my password in. And when it happens, a lot of graphical applications keep glitching and stuttering.
I've looked into the possible causes. When I checked the log, I found something like xhost: unable to open display "1". Apparently, this is an issue caused by the fact that my current display was set to 1. Running the command who confirmed this. I tried the solutions in this post, and some other posts I don't remember, but none of them worked.
Apparently, this issue is caused by something related to the fact that the main display (0) is occupied by something else during the login process and it has to use the next available display. I am not sure whether or not the display was also getting set to 1 in the same way before this problem started. All I know is it was 1 when I checked after the problem started.
Eventually, my workaround to this issue was by turning on the auto login for my user in settings, so that the login screen never appears. After I did this, the graphical glitches stopped, the logs no longer show the problematic lines, and the result of who returns that I am using the display 0. This is what I'm currently doing, but I still want to properly fix the issue (and not have to use auto-login), especially because this is a laptop I have to carry around in public a lot.
Right now, I don't know what kind of logs or outputs I should check, but I will add them if required.
Thank you in advance.