| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
There's no reason that seat0 having the initial VT on foreground should
trigger ensuring display on unrelated seats. Fix this by only checking
for the current VT if the newly ended session belongs to seat0.
|
|
|
|
| |
session terminates
|
|
|
|
|
|
|
|
|
| |
respawned on termination
Trigger ensuring a greeter session for a non-primary seat when it
terminates and only looking for displays with state of
GDM_DISPLAY_MANAGED when checking for duplicates in
ensure_display_for_seat on non-primary seats.
|
|
|
|
|
|
|
|
| |
instead of all seats
An user logging out from another seat shouldn't affect other users on
other seats. Limit ensuring a greeter session to the seat that have just
been logged out.
|
|
|
|
|
|
|
|
|
|
|
| |
looking up the display from display store
On non-primary seats, GDM will look up the display from display store
and abort ensuring a display for seat. This causes the seat to have no
active session when a user logs out, instead of the login screen.
Fix this by searching for greeter sessions from logind before looking up
the display from display store.
|
| |
|
|
|
|
|
|
|
|
|
| |
systemd-logind escapes the seat name prior to exposing as a DBus object.
As a result, seat names like "seat-name" may be escaped to
"seat_x2dname" when exposed as a DBus object.
Use DBus to acquire the seat name instead of using the last component of
the object path.
|
| |
|
| |
|
|
|
|
|
|
| |
There is no need to perform all the checks if the display is already
created. While at it, add a debug message to make easier to understand
the message when a display already exists.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
There is no case where seat_supports_graphics is TRUE while session_types is NULL.
Thus, after the following check:
```
if (!seat_supports_graphics)
return;
```
we can assume that session_types won't be NULL.
|
| |
|
| |
|
| |
|
|
|
|
| |
Unused since eba8deb7f92f473a40a8e277203d86aeab879bd1.
|
| |
|
|
|
|
|
| |
The error was never freed. While at it, convert also the id to use
g_autofree.
|
|
|
|
|
|
|
|
|
| |
There's a typo "tyes" instead of "types" leading to the wrong
supported session types getting set in some cases.
This commit fixes that.
Closes https://gitlab.gnome.org/GNOME/gdm/-/issues/808
|
|
|
|
|
|
|
|
|
|
| |
At the moment we still listen for udev events after we've determined
the system has settled (or a timeout has happened).
This means if there is a udev event late, the login screen could get
brought back up while the user is using the system.
This commit fixes that.
|
|
|
|
|
|
| |
Signal connection ids are 64-bit not 32-bit.
This commit fixes the type used.
|
|
|
|
|
|
|
|
|
|
|
| |
If GDM starts faster than graphics initialize, then the
udev rules that write out /run/gdm/custom.conf might get
run too late for GDM to notice.
This commit changes GDM to reread its config after graphicals
initialization completes.
https://gitlab.gnome.org/GNOME/gdm/-/issues/763
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment, GDM waits until systemd says the system supports
graphics (via the CanGraphical logind property).
Unfortunately, this property isn't really what we need, since it flips
to true when *any* graphics are available, not when the main graphics
for the system are ready.
This is a problem on hybrid graphics systems, if one card is slower to
load than another. In particular, the vendor nvidia driver can be slow
to load because it has multiple kernel modules it loads in series.
Indeed on fast systems, that use the vendor nvidia driver, it's not
unusual for boot to get to a point where all of userspace up to and
including GDM is executed before the graphics are ready to go.
This commit tries to mitigate the situation by adding an additional,
check aside from CanGraphical to test if the system is ready.
This check waits for the graphics card associated with boot to be fully
up and running before proceeding to start a login screen.
Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/763
|
|
|
|
|
|
|
| |
When active vt is gdm initial vt, restart greeter session. Avoiding
the blank screen when greeter session crashed.
https://gitlab.gnome.org/GNOME/gdm/-/issues/735
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment if Wayland doesn't work, the login screen will fall back
to Xorg, and if Xorg doesn't work the login screen will fall back to
Wayland.
But if the fall back choice is disabled explicitly, GDM will just crash.
This commit fixes the crash.
Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/739
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment in the shutdown path we may try to respawn displays
that just got killed.
The respawning happens when things are half torn down leading to
crashes.
This commit makes sure we turn off the respawn logic in the shutdown
path.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's currently a bug in computing the session-type to use.
The `i > 0` check means wayland will overwrite x11 in the
transient session type list.
Morever, the separation between "session-type" and
"supported-session-types" is a little redundant. Since
supported-session-types is a sorted list, the first item should
always be the same as "session-type".
This commit addresses the bug and the redundant logic, by computing
the supported session types early in the function and indexing into
it to get the session-type.
A future cleanup could probably get rid of session-type entirely.
https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/153
|
|
|
|
|
|
|
|
|
|
|
| |
commit f4922c046607c45d76e2911aa8f133d0ad4f9223 tried to
fix an overrun in the code, but it neglected to add
"continue" statements to the loops, so it was stuffing
two different values into the same element of an array,
which leads to the wrong session type getting preference.
This commit fixes that.
|
|
|
|
|
|
|
| |
Some confusion in the session type list generation from GNOME/gdm!146,
means we could actually overrun the list.
This commit fixes that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's currently a way to disable wayland, but no way to disable Xorg.
We currently prefer wayland if it's not disabled, but have no way to
prefer Xorg without disabling wayland entirely.
There's currently no way use legacy Xorg support at all if user display
server support is enabled at a build time.
This commit adds more flexibility to display server selection. It adds
two new keys: XorgEnable and and PreferredDisplayServer.
XorgEnable=false disables Xorg support entirely on seat 0.
PreferredDisplayServer can be set to "wayland", "xorg", "legacy-xorg" or
"none" to select which display server is used by default. If it's set to
"wayland", it will fall back to "xorg". If it's set to "xorg" it will
fall back to "wayland".
|
|
|
|
|
|
|
|
| |
In commit a37e5a950fbd ("local-display-factory: Wait for seats to become
graphical") we introduced logic to wait for up to 10s for the seat to
become graphical before trying to use it. Unfortunately, the logic was
slightly wrong, resulting us to immediately do the fallback rather than
waiting.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It may happen that seats are not graphical initially because the DRM
device is not ready yet. In that case, ignore the seat and wait for the
CanGraphical property notification in order to add it at that point.
However, there are some rare cases where CanGraphical will never turn
TRUE. To catch these, add a timeout and fall back to simply trying to
bring seat0 up after 10 seconds. When we do so, go directly for the X11
fallback as wayland is unlikely to be functional.
Fixes: #662
|
|
|
|
|
|
|
|
|
|
|
| |
We used to check the session type when enumerating the seats at startup
(and on VT switch). However, this misses cases where seats are added
dynamically (such as at boot time).
Simply move the check into create_display and pass in the failure count
so that it can handle the X11 fallback when wayland failed to come up.
Related: #662
|
|
|
|
| |
Also drop the return value as it is never used.
|
|
|
|
| |
It's deprecated now, and always returns TRUE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit ac083ec2d3d663a48c4aa6693978669243880dd0 attempted fix killing
X in the background even when wayland support is disabled.
Unfortunately, it missed yet more places in the code that does
ifdef ENABLE_WAYLAND_SUPPORT
endif
This commit fixes that.
Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/614
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit d35805116113acbf1e112962c54785c604b13181 changed GDM to
kill X on login just like it does for wayland sessions.
Unfortunately, that commit neglected to pull the code out of the
ifdef ENABLE_WAYLAND_SUPPORT
endif
guards, so users who build without wayland support entirely, don't
get the feature.
This commit fixes that.
Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/614
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These days we kill the wayland login screen during login to
conserve system resources.
We've been reluctant to do the same for X based login screens,
because X didn't handle being killed in the background so well.
This is no longer a problem, since this commit:
https://gitlab.freedesktop.org/xorg/xserver/-/commit/ff91c696ff8f5f56da40e107cb5c321539758a81
So let's go ahead and kill it now.
|
|
|
|
|
|
|
|
|
|
|
|
| |
These days we always want the login screen on VT 1, even
when it's created by user switching.
Unfortunately, since commit f843233ad the login screen
won't naturally pick VT 1 when user switching.
This commit forces it to make the right choice.
Closes https://gitlab.gnome.org/GNOME/gdm/-/issues/602
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 1c061b84ffc3e874da825982d18d970556ff74bb we reap the login
screen after the user logs into a session, instead of after a timeout.
Unfortunately, that means we no longer reap the login screen when
unlocking a session.
This commit adds back the timeout in the case seat0 is switched to a
registered login session.
Closes https://gitlab.gnome.org/GNOME/gdm/issues/509
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recording when sessions start, for Wayland → Xorg fallback or
transitioning to the user session, is currently done with timeouts.
This isn't ideal, because on some very slow machines the timeout can be
hit before the session has had a chance to fail: if gnome-session takes
more than 3 seconds to fail then the session will be considered to have
exited rather than failed, and so we don't do Xorg fallback.
We can do this more reliably if we allow sessions to optionally register
themselves with GDM. Then we will know when they've started, so can shut
down the greeter or fall back to Xorg as appropriate. The mechanism is
that they specify X-GDM-SessionRegisters=true in their file, and then
call RegsterSession on the DisplayManager interface on the bus (added in
the previous commit) to say that they've started up.
If X-GDM-SessionRegisters is missing or false, GDM will call the same
method for them after 10 seconds.
Closes: #483
|
|
|
|
| |
This makes the code a fair bit simpler.
|
|
|
|
|
|
|
|
| |
The local display factor code is returning FALSE from its
display store foreach functions, which is useless since commit
47d01abe.
This commit makes it return void instead.
|
| |
|
|
|
|
|
|
|
|
| |
We may end up re-using a display in waiting-to-finish state before it gets
finished in this case reset its state to managed to avoid it getting
finished while it is being used.
Closes https://gitlab.gnome.org/GNOME/gdm/merge_requests/45
|
|
|
|
|
|
|
|
|
| |
We avoid changing to the login screen vt if we're already on it,
but the call is racy since we react to vt changes concurrently
with logind (who we query for the active vt).
This check drops the active vt check since it's pointless and
getting in the way.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial VT is in use check in on_vt_changed() is racy, when switching
to VT1 from an active session, on_vt_changed() may run before logind has
processed the VT change and then sd_seat_get_active() will return the
active session which we are switching away from. This results in the greeter
not being started on VT1.
On my system gdm reliably wins the race resulting in not getting a greeter
when manually switching from an active session to VT1.
gdm already starts the greeter unconditionally from
gdm_local_display_factory_sync_seats() on both startup and when an user
session exits. gdm also starts it unconditionally when selecting
"Switch user" from an user session.
Now autologin sessions avoid the initial VT as well.
So we now can assume that the initial VT is free for the login screen's
use. And create_display already checks for and re-uses
an existing greeter, so we can safely remove the racy check.
|
|
|
|
|
|
|
|
| |
We automatically kill the login screen when switching VTs away
from it, but we should never kill the initial-setup screen in
that situation.
This commit adds a check to prevent that from happening.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gdm-local-display-factory
Commit 708618746683 ("gdm-wayland-session,gdm-x-session: register after
delay") delayed displays changing their status from PREPARED to MANAGED
so that their status would not change until the session has had a change
to install its own framebuffer and tell the GPU to scanout this new fb.
Commit 74ee77717df7 ("local-display-factory: defer killing greeter until
new session registers") uses this to avoid a flicker when transitioning
from the greeter to the user-session by deferring the stopping of the
greeter-session until the new display moves to the MANAGED state.
But this only works when transitioning to a new user-session, when moving
to an existing user-session (fast user switching) the display already
is in MANAGED state and instead of deferring the stopping of the greeter
commit 74ee77717df7 causes us to now never stop the greeter-session.
This commit fixes this by starting a timeout when switching away from
the initial-vt and letting that timeout stop the greeter-session.
This commit removes the finish_waiting_displays_on_seat() call when the
display's status changes to MANAGED, so that we still only have one code
path stopping the greeter and not two.
This means we also no longer need to delay registering the display. So this
commit removes the code adding the delay (reverts commit 74ee77717df7).
Note this commit uses a delay of 10 seconds, rather then 2 seconds. The
transition to a new user-session takes about 8 seconds on my budget
Apollo Lake based laptop (with SSD).
Note this all really is a workaround, the proper solution for this would
be able to tell the kernel to keep the greeter framebuffer around until
a new framebuffer is installed. There is a patch to add a new unref_fb
ioctl for this: https://www.spinics.net/lists/dri-devel/msg140912.html .
We need to get this patch upstream and teach mutter to use it.
|