summaryrefslogtreecommitdiff
path: root/daemon/gdm-local-display-factory.c
Commit message (Collapse)AuthorAgeFilesLines
...
* local-display-factory: fix build with --disable-user-display-serverRay Strode2018-09-011-1/+1
| | | | | | | | | | | | | 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
* local-display-factory: defer killing greeter until new session registersRay Strode2018-08-311-6/+37
| | | | | | | | | | | | 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
* local-display-factory: ignore spurios SeatNew signal at start upRay Strode2018-08-141-7/+26
| | | | | | | | | | | | | | 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
* display-store: Pass the display object rather than the id in the removed signalChris Coulson2018-08-131-10/+3
| | | | | | | | | | | | | 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
* local-display-factory: add some more debug statementsRay Strode2018-08-091-0/+5
| | | | | This commit just sprinkles in a few more `g_debug`'s for log file clarity.
* local-display-factory: don't jump to failed displayRay Strode2018-08-091-4/+15
| | | | | | | | | | | | 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.
* local-display-factory: don't start two greeters at startupRay Strode2018-08-081-0/+6
| | | | | | | | | | | | | | | | 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
* local-display-factory: add more debug messages to new vt handling codeRay Strode2018-08-081-9/+35
| | | | | | | | | | 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.
* daemon: kill and restart greeter on demand under waylandRay Strode2018-08-031-0/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* local-display-factory: ensure non-seat0 codepath doesn't affect seat0Ray Strode2018-08-031-1/+1
| | | | | | | | | | 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.
* daemon: try harder to get to a login screen at logoutRay Strode2018-08-021-5/+31
| | | | | | | | | | | | | 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.
* local-display-factory: Use correct session-type for new transient displaysHans de Goede2018-08-021-0/+2
| | | | | | 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().
* local-display-factory: Add gdm_local_display_factory_use_wayland() helperHans de Goede2018-08-021-8/+15
| | | | | Factor out the code which decides if Xorg or Wayland should be used into a helper function.
* display-factory: avoid removing a display from store while iterating itLubomir Rintel2018-07-171-5/+2
|
* Use standard exit codes.Robert Ancell2017-10-031-2/+2
| | | | | | | | | 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
* daemon: check for Xwayland availabilityFrederic Crozat2017-09-181-1/+1
| | | | | | | prevent gnome-shell crash when testing Wayland session if Xwayland isn't installed. https://bugzilla.gnome.org/show_bug.cgi?787837
* local-display-factory: add missing comma to fix user switchingRay Strode2017-04-031-1/+1
| | | | | | | | | | 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
* daemon: add knob to disable starting X server as userRay Strode2017-02-271-1/+12
| | | | | | | | | | | | 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
* local-display-factory: disconnect signal handlers when factory is disposedRay Strode2016-06-221-11/+15
| | | | | | | | | | | | 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)
* local-display-factory: don't sweat hardcoding seat0 for transient displaysRay Strode2015-11-061-12/+1
| | | | | | 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.
* local-display-factory: drop obsolete FIXMERay Strode2015-11-061-2/+0
|
* local-display-factory: track autologin displaysRay Strode2015-09-101-5/+56
| | | | | | | | | | | | 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
* local-display-factory: call sync function after display finishesRay Strode2015-09-101-2/+7
| | | | | | | | | | | | | | | | | | 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
* local-display-factory: spacing clean upRay Strode2015-09-101-1/+2
| | | | | | | | | | 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
* require logind supportRay Strode2015-06-121-42/+4
| | | | | | | Now that consolekit support is gone, this commit drops all the conditionalizing of logind support. https://bugzilla.gnome.org/show_bug.cgi?id=743940
* drop consolekit supportRay Strode2015-06-121-10/+1
| | | | | | It was deprecated in 3.16 to be removed in 3.18 https://bugzilla.gnome.org/show_bug.cgi?id=743940
* local-display-factory: don't use seat0 if logind not runningRay Strode2015-03-191-4/+8
| | | | | | | | | | We currently only allow ConsoleKit seats if GDM is built without systemd support, but it's possible to build GDM with systemd support and not be running logind. This commit fixes it to do a run time check. https://bugzilla.gnome.org/show_bug.cgi?id=746497
* local-display-factory: fix daemon/WaylandEnableMarc-Antoine Perennou2015-02-191-1/+1
| | | | Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
* local-display-factory: provide override for disabling waylandRay Strode2015-02-181-1/+8
| | | | | | | | | | Since this wayland code is still pretty new, we need to provide an exit tactic for users. This commit introduces daemon/WaylandEnable which can be set to false, to disable wayland support. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* local-display-factory: use wayland by default for greeter, fallback to X11Ray Strode2015-02-181-5/+24
| | | | | | | | This commit flips the big red switch, now we use wayland by default on the greeter and only fallback to X / legacy code paths in exceptional situations. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* local-display-factory: only set is-initial on first seat0 displayRay Strode2015-02-181-2/+11
| | | | | | | | | | | | is-initial is for hardcoding vt1 on the X server command line. VTs only make sense on seat0, so GdmServer as ignoring is-initial on auxilliary seats. This commit makes sure that is-initial never gets set in the first place for auxilliary seats, and deletes the code the overrides its value. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* session: start login screen using session wrappersRay Strode2015-02-181-13/+37
| | | | | | | | | | | | | | | Since we have the wrappers, let's use them for the login screen, too, when we can. This commit removes GdmServer from GdmLocalDisplay, since starting the X server should be handled implicitly by gdm-x-session, now. All the old logic is now in a new GdmLegacyDisplay object, that will remain for cases where gdm-x-session doesn't work. (ConsoleKit systems, non-seat0 displays, etc) https://bugzilla.gnome.org/show_bug.cgi?id=744764
* local-display-factory: don't assume display has display numberRay Strode2015-02-181-2/+3
| | | | | | | | logind managed displays don't have (known) display numbers, so we shouldn't assert that there's going to be one on display status changes. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* local-display-factory: drop some superfluous codeRay Strode2015-02-181-6/+2
| | | | | | | | | | | | | | The store_display function takes a display number as an argument, it then uses that display number to reserve a slot in the "used display numbers" hash table. There's no reason for it to do this though, because the slot is already reserved when the next available display number is looked up in take_next_display_number. This commit drops the superfluous code. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* local-display-factory: rename 'displays' to 'used-display-numbers'Ray Strode2015-02-181-10/+10
| | | | | | | | | GdmLocalDisplayFactory has a hash table called "displays" that doesn't hold displays. It instead holds a list of used display numbers. This commit renames the hash table accordingly. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* display: merge GdmStaticDisplay and GdmTransientDisplayRay Strode2015-02-181-7/+9
| | | | | | | They basically do the same thing with very minor differences, so merge them into a new GdmLocalDisplay object. https://bugzilla.gnome.org/show_bug.cgi?id=744764
* Fix checks for logindMartin Pitt2013-03-291-5/+2
| | | | | | | | | | | | It is possible to build systemd without logind or run logind without systemd init, in both cases testing for systemd init is wrong. Check for /run/systemd/seats in the parts which talk to logind instead, as recommended by systemd upstream. For details, see: <https://mail.gnome.org/archives/desktop-devel-list/2013-March/msg00092.html> https://bugzilla.gnome.org/show_bug.cgi?id=696266
* Trivial: Update FSF Address.Dominique Leuenberger2012-09-061-1/+1
| | | | Fix bug 683383.
* Use correct types in on_seat_new and on_seat_removedDave Airlie2012-08-301-2/+2
| | | | | | | The message is actually a tuple of a string + object path, not just a single string. https://bugzilla.gnome.org/show_bug.cgi?id=682758
* gdm: always run gdm on VT1Lennart Poettering2012-08-061-7/+12
| | | | | | | | | | | | | | | This drops automatic VT allocation schemes for the initial display in favour of a compile time hardcoded VT assignment. The automatic allocation schemes are inherently racy since a simpler output to the console might already influence it and result in gdm running on another than the intended VT. This patch adds a --with-initial-vt= switch to configure which may be used to set the VT gdm will run the initial server on. It defaults to 1. https://fedoraproject.org/wiki/Features/DisplayManagerRework https://bugzilla.gnome.org/show_bug.cgi?id=511168
* daemon: Remove transient displays from display store when finishedGiovanni Campagna2012-07-171-20/+34
| | | | | | | | | | | | | | | | | When a display finishes (because it failed to start, or the users session ended) the GDM display handling code needs to remove the display from its display store. For static (logind or the first automatic) displays this happens in the on_static_display_status_changed function. For transient (user-switch initiated) displays, though, it never happens. This commit reworks on_static_display_status_changed into a more generally applicable on_display_status_changed function, so the proper bookkeeping can happen for transient displays, too.
* daemon: Port display handling to GDBusGiovanni Campagna2012-07-171-127/+130
| | | | | | | | This is one big commit because it uses generated code both in the daemon and in the slaves, so we need to port both at the same time. https://bugzilla.gnome.org/show_bug.cgi?id=622888
* daemon: drop if 0'd codeRay Strode2012-07-131-4/+0
| | | | It's referencing api we don't have anymore.
* daemon: clean house (drop factory mode)Ray Strode2012-07-061-49/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | GDM has a currently unused feature called "factory mode", where the login screen gets allocated its own VT and any subsequent logins from that login screen go to their own VT. Any time there's a user switch GDM just jumps back to initial VT where the login screen is patiently waiting. This feature has a lot of upsides, and we've had it as a TODO item to start using it for while now. It doesn't look it's going to happen in the near term, though, and factory mode has downsides as well: - a VT switch after the user hits enter at the login screen would be jarring and would ruin the "flicker free" boot experience we've tried to acheive at various points in the past. This could theoretically be fixed by Wayland. - it adds a bunch of untested, unused code to the codebase. This latter reason makes me want to kill it for now. It shouldn't be hard to resurrect later if we end up needing the feature. This commit drops that code.
* user-switching: fix seat id confusionRay Strode2012-03-191-4/+22
| | | | | | | | | | There's a few places in the code that was hardcoding consolekit paths still. This commit does some small changes to make that more systemd compatible. https://bugzilla.gnome.org/show_bug.cgi?id=655380
* local-display-factory: subscribe to new seats being created and removedLennart Poettering2012-02-071-16/+223
| | | | | | logind will notify us when ever a new seat becomes available in the system, or an existing seat is removed. We simply create a new display for each seat showing up and remove a display when a seat goes away.
* daemon: build fixRay Strode2011-06-201-0/+1
| | | | Add variable declaration.
* Revert some commitsRay Strode2011-06-171-33/+32
| | | | | | | | | | | | I had some inprogress changes in my local tree when when git bz applying the patches on bug 618047. Those unfinished changes got interleaved into the commits, creating a bit of a mess. Also, bug 618047 has been reopened. This commit reverts those changes for now until.
* daemon: drop some fluff codeRay Strode2011-06-151-1/+0
| | | | | | | There's a bit of needless boilerplate and dead code just sort of sitting around in various places. This commit cleans things up a bit.
* daemon: drop static-factory-display stuffRay Strode2011-06-151-1/+0
| | | | | It's not used. If we need it later we can bring it back from history.