| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit cf8d918f added a call to `lookup_by_session` which
was previously only defined when built GDM was built with
`--enable-user-disable-server`.
That causes the build to fail with `--disable-user-display-server`.
This commit fixes the build by moving `lookup_by_session` out
of conditionalized code.
Closes https://gitlab.gnome.org/GNOME/gdm/issues/416
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment we kill the greeter the second the VT change to the new
session happens.
That can cause flicker if the new session doesn't take over the display
quickly enough.
This commit defers killing the greeter until the new display registers.
Closes https://gitlab.gnome.org/GNOME/gdm/issues/413
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes during startup, logind will send a `SeatNew` signal for
seat0 after GDM has already called `ListSeats` and processed `seat0`.
That `SeatNew` signal leads to GDM calling `create_display` twice in
quick succession.
This commit changes GDM to avoid such double processing, by ignoring
the `create_display` requests for seats that already have a prepared
display ("prepared" means "starting up").
Closes: https://gitlab.gnome.org/GNOME/gdm/issues/410
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By the time GdmDisplayStore emits the "display-removed" signal, the display
is no longer in the store and gdm_display_store_lookup will not work in
signal handlers.
Change the "display-removed" parameter from the display id to the GdmDisplay
object, so that signal handers can perform any cleanup they need to do
CVE-2018-14424
Closes: https://gitlab.gnome.org/GNOME/gdm/issues/401
|
|
|
|
|
| |
This commit just sprinkles in a few more `g_debug`'s for
log file clarity.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 5e737a57 `create_display` will jump to any
already running login screen if it can find one.
Right now if a display fails we call `create_display` to
create a new one. It will look for any already running
login screen and find the recently failed display.
This commit make sure we never jump to a display that isn't
in good working order.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit c0188a7030 added some complex code for starting
the login screen when the user switches to the initial
VT if nothing is running on that VT.
The problem is, we get a VT change event on that VT as
part of the start up process.
This leads to an additional greeter getting started.
This commit adds a check to side step the new code during
startup.
Closes: https://gitlab.gnome.org/GNOME/gdm/issues/409
|
|
|
|
|
|
|
|
|
|
| |
commit c0188a7030 added some complex code for starting and stopping
the login screen based on VT changes.
That code currently has zero debug statements in it making it trickier
than necessary to debug.
This commit sprinkles some g_debug's throughout the function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now we leave the greeter alive after the user logs in.
This is for two reasons:
1) When the greeter is running Xorg, there's no way to kill
it when it's running on an inactive VT (X jumps to the foreground
when being killed)
2) The greeter, in a way, provides a securepath for unlock.
Users in theory could know that by hitting ctrl-alt-f1 to secure
attention, the login screen presented is not spoofed.
Since we use wayland by default, 1 isn't that much of a concern,
and 2 is a bit of niche feature that most users probably haven't
considered.
And there's a huge downside to keeping the greeter alive: it uses
a very large amount of memory.
This commit changes GDM to kill the login screen when switching
away from the login screen's VT and restarting it when switching
back.
Based heavily on work by Hans de Goede <hdegoede@redhat.com>
Closes: https://gitlab.gnome.org/GNOME/gdm/issues/222
|
|
|
|
|
|
|
|
|
|
| |
create_display currently bails in some cases if any display is running
on the seat. That's the right thing to do on seats other than seat0,
but wrong for seat0 (which an have multiple sessions at the same
time).
To ensure we never hit the case for seat0, add a call to check if
the passed seat is multi-session capable.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 22c332ba and some follow up commits try to ensure the
user never stays on a blank VT by jumping to a login screen in
the event they'd end up on one.
Unfortunately, that part of the code can't start a login screen
if there's not one running at all.
This commit moves the code to GdmLocalDisplyFactory where the
login screens are created, so users won't end up on a blank
VT even if no login screen is yet running.
|
|
|
|
|
|
| |
Use the new gdm_local_display_factory_use_wayland() helper to correctly
set the session-type properties for displays created through
gdm_local_display_factory_create_transient_display().
|
|
|
|
|
| |
Factor out the code which decides if Xorg or Wayland should be used into
a helper function.
|
| |
|
|
|
|
|
|
|
|
|
| |
Use EXIT_ defines for readibility.
There were some exit codes > 1, but they don't seem to be checked by any of the
parent process code. This does mean that the logs might have changed, but
modern logging techniques have probably made this obsolete.
https://bugzilla.gnome.org/show_bug.cgi?id=788307
|
|
|
|
|
|
|
| |
prevent gnome-shell crash when testing Wayland session
if Xwayland isn't installed.
https://bugzilla.gnome.org/show_bug.cgi?787837
|
|
|
|
|
|
|
|
|
|
| |
commit 4b47633b36a22195e7976a8e597862eff695ca86 refactored some code
and inadvertently dropped an important comma, which broke user
switching.
This commit reintroduces the comma.
https://bugzilla.gnome.org/show_bug.cgi?id=780879
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some deployments need to be able to turn off running X servers as a
user for backward compatibility.
This commit adds some #ifdef goop to that end.
Note wayland requires running as the user, so this option, merely
deprioritizes wayland sessions under X sessions.
https://bugzilla.gnome.org/show_bug.cgi?id=779338
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's the potential for a crash in the shutdown path after the
factory is disposed, since we fail to disconnect signal handlers to
the displays / display store at factory dispose time.
This commit changes the g_signal_connect to g_signal_connect_object, to
avoid any potential for crash.
(this is a fix noticed when reading through the source. It's tangentially
related to a discussion on irc for a different bug)
|
|
|
|
|
|
| |
seat0 is the only thing that has a chance of supporting multiple
sessions at th moment, so drop the FIXME that we won't be making
traction on.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
At the moment the display-factory only tracks displays it adds itself.
autologin displays aren't added by the display-factory, but by the
manager.
This commit makes sure the display-factory is notified about the
autologin display, so when it finishes a login screen can be put in
its place.
https://bugzilla.gnome.org/show_bug.cgi?id=749418
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now if a local display finishes we create a new one of the
same type to replace it. But if a user display finishes we don't
want to create a new user display, we want to create greeter
display. Furthermore if the user session is X11, we still want the
login screen that comes up to be wayland by default.
This commit changes the code to just call sync_seats after a display
finishes, since sync_seats is where the logic for where the login
screen display information is stored.
sync_seats is idempotent anyway, and will only create displays for
seats that need them, so it's safe to call it any time any local
display finishes.
https://bugzilla.gnome.org/show_bug.cgi?id=749418
|
|
|
|
|
|
|
|
|
|
| |
The function declaration for gdm_local_display_factory_sync_seats
put the return type on the same line as the function name. That
doesn't follow the GDM codebase's style.
This commit moves the return type to its own line.
https://bugzilla.gnome.org/show_bug.cgi?id=749418
|
|
|
|
|
|
|
| |
Now that consolekit support is gone, this commit drops all
the conditionalizing of logind support.
https://bugzilla.gnome.org/show_bug.cgi?id=743940
|
|
|
|
|
|
| |
It was deprecated in 3.16 to be removed in 3.18
https://bugzilla.gnome.org/show_bug.cgi?id=743940
|