summaryrefslogtreecommitdiff
path: root/libgdm
Commit message (Collapse)AuthorAgeFilesLines
* libgdm: Fix session loading precedenceRay Strode2023-05-161-2/+3
| | | | | | | | | | | | | | | | | | | | One feature that GDM is supposed to support is a precedence order for loading xsession files. If someone has a file in /etc/X11/sessions it's supposed to override a file in /usr/share/xsessions. This works okay from a backend point of view. /etc/X11/sessions can change the command getting run, for instance, but it doesn't work from a front end point of view. Menu items can't get hidden in the session cog. This is due to a bug in libgdm where it inadvertently gives /usr/share/xsessions higher precedence than /etc/X11/sessions. This commit fixes that by processing the lists in reverse order, and making sure to remove already added entries if overriding entries are hidden.
* meson: allow building with elogindDudemanguy2023-04-281-1/+1
| | | | | | | Currently, the GDM meson build has a hard dependency on systemd. However, GDM can function just fine if one is using elogind. This allows a user to build GDM against libelogind and also disable the systemd system and user units.
* gdm-client: Remove dead codeAlessandro Bono2022-10-271-2/+0
| | | | 'client' is unused.
* libgdm: Handle GDM_SUPPORTED_SESSION_TYPES being unsetWill Thompson2021-12-211-1/+5
| | | | | | | | | | | | | | If GDM_SUPPORTED_SESSION_TYPES is not set in the environment, calling any libgdm function which internally calls collect_sessions() will log a CRITICAL from trying to g_strsplit() a NULL string. This may happen if, for example, a developer is launching gnome-shell directly, rather than it being launched by GDM. Don't try to split the NULL string. The rest of collect_sessions() already gracefully handles supported_session_types being NULL, so no further changes are needed to the function. Fixes: https://gitlab.gnome.org/GNOME/gdm/-/issues/748
* libgdm: Sort session listRay Strode2021-07-221-0/+19
| | | | | | Right now the session list comes out in hash table order. This commit changes the code to sort by description.
* daemon: Provide more flexibility for configuring display serverRay Strode2021-07-221-20/+52
| | | | | | | | | | | | | | | | | | | 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".
* daemon,common,libgdm: Drop use of sd_seat_can_multi_sessionRay Strode2021-02-251-18/+0
| | | | It's deprecated now, and always returns TRUE.
* libgdm: Track reauth user verifier toowip/more-gdm-client-fixesRay Strode2020-11-121-3/+18
| | | | | | | | The unlock screen may have user verifier extensions too, so we need to track the reauth user verifier, too. This API is clearly less than optimal, but fixing it is a task for another day.
* libgdm: use g_set_weak_pointer instead of g_object_add_weak_pointerRay Strode2020-11-121-90/+42
| | | | This makes the code much tidier.
* libgdm: Fix typo where user data is grabbed from wrong placeRay Strode2020-11-121-1/+1
| | | | | | | | | | Since commit 2615fb4ffe05b2640c15f4a9706796fe3b1376a9 user verifier extensions are stored as user data on the user verifier object. Unfortunately that commit, mixed up where the user verifier object was in place. This commit fixes that.
* libgdm: Don't leak user verifier extensions on unlockwip/libgdm-proxy-leaksRay Strode2020-11-031-22/+48
| | | | | | | | | GdmClient fails to free the hash table associated with user verifier extensions when the client is done with the user verifier. This commit ties the user verifier extensions to the user verifier instance associated with it, instead of storing the extensions directly in the client struct.
* libgdm: Fetch connection synchronouslyRay Strode2020-11-031-85/+9
| | | | | | | | | | | There's a race condition in the client connection code at the moment, where a user verifier could be waiting for its connection when the login screen asks for a greeter synchronously. The greeter will then end up with a different connection that the user verifier which breaks expectations. This commit just makes the connection fetching code synchronous for now to side step the problem.
* libgdm: Fix client leaks from g_async_result_get_source_objectRay Strode2020-11-031-3/+3
| | | | | | | | There are are few places in the code where the client object is retrieved via g_async_result_get_source_object. Those calls return a fresh reference that is never unreferenced later. This commit plugs those leaks by using g_autoptr's
* Drop autogoo goo gooRay Strode2020-04-301-126/+0
| | | | | | Our turkey has freezer burn, so I'm dropping it. https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/96
* data: switch gdm.service.in to use cmake formatNiels De Graef2020-04-302-0/+110
| | | | | | | | | | We're going to be switching to meson, and meson doesn't deal too well with an @ in the configuration file that's not part of a substitution variable. This commit switches the gdm service over to use a cmake style of substitution variables, so we can later tell meson to use configure in cmake mode and workaround the @ confusion.
* manager: Try looking up session based on PID firstBenjamin Berg2020-04-221-1/+1
| | | | | | | | | | | | | | Unfortunately, GDM may be running multiple greeters, and each greeter is currently using the same user. So while in a lot of setups each user should only have one graphical session and also only one DBus session bus, this is not true for the gdm greeter. Lacking another solution (e.g. separate users), we need to be able to correctly lookup the session information for all greeter instances. We can do so by using sd_pid_get_session and using this information is safe if it does return something. See: #526
* libgdm: Remove duplicate sessions when on XorgXiaoguang Wang2019-09-261-1/+2
| | | | | When gdm works on Xorg it's possible to have duplicate sessions, we need to remove them.
* sessions: Remove unused 'id' variableMarco Trevisan (Treviño)2019-08-131-2/+0
| | | | | | | The duplicate sessions id is not used in remove_duplicate_sessions(), so remove it to mute the warning. https://gitlab.gnome.org/GNOME/gdm/merge_requests/75
* sessions: Use auto pointer GPtrArray to allocate session dirsMarco Trevisan (Treviño)2019-08-131-16/+14
| | | | | Gdm leaks session dir names, so use a ptr array with a free function and auto-pointers to manage the strings lifecycle.
* manager: Find user's current graphical session, not session of callerwip/benzea/systemd-userIain Lane2019-08-052-5/+4
| | | | | | | If (e.g.) gnome-shell is started as a systemd --user unit, it won't be part of the login session. We should instead look through all of the user's sessions until we find the login session, and take that as our session.
* libgdm: Always de-duplicateIain Lane2019-03-161-1/+1
| | | | | I put this inside an `#ifdef ENABLE_WAYLAND_SUPPORT` before, which would mean that it's not called if that's not defined.
* libgdm: Remove duplicate sessions once, after all sessions have been processedIain Lane2019-03-151-16/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We add sessions to a hash table keyed on the basename without extension, and while we're adding them we de-duplicate based on the translated name (the text that will be visible in the switcher). This has a problem. In this situation: ``` laney@disco:~$ tree /usr/share/{wayland-,x}sessions/ /usr/share/wayland-sessions/ ├── gnome.desktop └── ubuntu-wayland.desktop /usr/share/xsessions/ ├── gnome.desktop -> gnome-xorg.desktop ├── gnome-xorg.desktop └── ubuntu.desktop ``` We process the X sessions first, and then the Wayland sessions. The deduplication might end up removing `xsessions/gnome-xorg` and leaving `xsessions/gnome`. Then when we come to process the Wayland sessions, we will clobber `xsessions/gnome` with `wayland-sessions/gnome`, as they have the same ID. When everything is working, it is actually *intentional* that `xsessions/gnome` gets clobbered, so that you end up seeing "GNOME" (wayland) and "GNOME on Xorg" in the switcher, and not (e.g.) "GNOME on Xorg" twice, and you have the correct fallback behaviour in case you ever enable/disable Wayland. Instead of filtering while we add things, we can add all the sessions we find (clobbering duplicate IDs as before), and then process the list once at the end, removing sessions with duplicated visible names at that point. Closes: #473
* Remove erroneous NULL from session search directoriesTomasz Miąsko2019-03-131-2/+0
| | | | Fixes issue #470.
* build: Don't dist generated filesIain Lane2019-02-251-1/+3
| | | | | | Various generated files are ending up being disted, which is wrong becuase they leak the maintainer's prefix into the tarball and are generated anyway during build.
* libgdm: filter out sessions with duplicate nameszhengqiang1302019-01-071-1/+16
| | | | | | | | | | | Right now if two session files have the same translated name, the login screen will show both of them. There's no way the user can know which session does which, so that's not a great user experience. Furthermore, in the face of symlinks, both sessions truely could be identical. This commit filters out the duplicates, so only one shows in the list. Closes https://gitlab.gnome.org/GNOME/gdm/issues/437
* client: use G_DECLARE_FINAL_TYPENiels De Graef2018-12-232-140/+110
| | | | This also gets rid of the deprecated `g_type_class_add_private()`
* Search sessions in XDG_DATA_DIRSJan Tojnar2018-08-271-4/+32
|
* libgdm: use g_autoptr to manage objects lifecycleMarco Trevisan (Treviño)2018-06-121-153/+111
| | | | | Using auto pointers allows to manage things in a cleaner way without having to manually unref things before returning.
* libgdm: Return NULL on invalid client instancesMarco Trevisan (Treviño)2018-06-041-8/+8
|
* libgdm: Don't save manager addressMarco Trevisan (Treviño)2018-06-021-15/+9
| | | | | There's no need to keep the manager connection address around, and use autofree to clean it up
* libgdb: Try to reuse connections from the available proxiesMarco Trevisan (Treviño)2018-06-021-31/+39
| | | | | | | | | Instead of using the hard-to-maintain shared pointer to the dbus connection to the manager and reset it when the proxies that use it are deleted, just look which proxy is currently available and try to reuse the connection from it. Fixes #386
* libgdm: Use auto-pointers and cleanup codeMarco Trevisan (Treviño)2018-06-021-8/+5
|
* libgdm: Don't leak connection on sync re-authenticationMarco Trevisan (Treviño)2018-06-021-1/+1
|
* libgdm: Don't double-ref the connection got from taskMarco Trevisan (Treviño)2018-06-021-2/+2
| | | | | | | | Both if we re-use the shared connection in `gdm_client_get_connection` and if we create a new one in `on_connected`, we steal the pointer here by using `g_task_propagate_pointer` and thus we don't have to add an additional reference to this connection when returning, or it won't ever be consumed by function customers.
* libgdm: Unref the manager propagated from taskMarco Trevisan (Treviño)2018-06-021-1/+3
| | | | | | | | | This instance has already been reffed when passed to the task, and since we're stealing it with `g_task_propagate_pointer` it won't be unreffed. We could also do this in the `on_reauthentication_channel_opened` callback but since the new task will ref it anyway, we can just be clean and do it here.
* libgdm: Drop weak refs on the GDBusConnectionIain Lane2018-05-161-47/+0
| | | | | | | | | The GDBusProxies hold a strong reference to the connection themselves, so maintaining separate weak references is unnecessary. This commit drops those extraneous weak references. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: get connection explicitlyMarco Trevisan (Treviño)2018-05-161-54/+82
| | | | | | | | | | | At the moment we call gdm_client_open_connection and when it finishes, assume client->priv->connection is implicitly initialized. This commit makes the operation more explicit by changing gdm_client_open_connection to gdm_client_get_connection and returning the GDBusConnection object directly, instead of returning a boolean. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: use g_object_unref instead of g_clear_object for weakrefsRay Strode2018-05-161-8/+8
| | | | | | | | | | | At the moment we add a weakref on each proxy to the connection object. For the _sync variant functions, When the weakref fires, they call g_clear_object, clearing the connection, even if other proxies still have a reference. This commit changes that weak ref code to use g_object_unref instead. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: don't keep manager proxy around longer than we need itRay Strode2018-05-161-93/+26
| | | | | | | | | | | | Right now we keep the manager proxy alive long after we need it. It doesn't get cleared until one of the other proxies go away. That is not only unnecessary but illogical and confusing. This commit changes the manager proxy to be transient—only alive long enough to get what we need from it. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: fix pointer/boolean task confusionRay Strode2018-05-161-2/+6
| | | | | | | | | The manager fetching code in GdmClient treats its task return value as boolean, but it's actually a pointer (the manager) This commit corrects the confusion. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: drop support for serializing multiple opensRay Strode2018-05-161-71/+40
| | | | | | | | | | | | | | | | | | Right now libgdm tries to handle multiple simultaneous open calls at the same time by serializing the requests and giving them all the same connection. It's broken, though. - The pending_opens list is never populated, so we end up just doing multiple simultaneous open operations at a time anyway. - The finish code ends up calling g_task_return_error (task, NULL) instead of g_task_return_pointer in the non-error case. Since the feature doesn't work, drop it for now. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: add weak pointer for connection objectMarco Trevisan (Treviño)2018-05-161-0/+12
| | | | | | | | | At the moment we fail to nullify GdmClient's connection to GDM when the connection is disposed. This commit adds a weak pointer to correct that mistake. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: Don't unref a connection that's in useMarco Trevisan (Treviño)2018-05-161-0/+2
| | | | | | | | | | | | | If an async task tries to reuse an open connection, it erroneously explicitly unrefs it. That is incorrect, because there are weak references in use to handle disposing the connection when its no longer in use. This commit makes sure the local connection object in open_connection is nullified so the connection doesn't get autofree'd. https://bugzilla.gnome.org/show_bug.cgi?id=795940
* libgdm: "Fix" a memory leakFlorian Müllner2018-02-261-1/+11
| | | | | | | | | | The gdm_available_sessions_map hash table is set up with a value-free function that frees the struct itself, but not its contents. Of course elements are never removed from the map, so this fix doesn't matter in practice. https://bugzilla.gnome.org/show_bug.cgi?id=793855
* Replace deprecated GSimpleAsyncResult with GTaskRobert Ancell2017-12-141-296/+235
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=783082
* Generate autocleanup definitions in libgdmRobert Ancell2017-12-052-0/+6
|
* Add missing dependency to .pc fileRobert Ancell2017-12-051-0/+1
|
* libgdm: add api for getting at ChoiceList interfaceRay Strode2017-10-202-2/+218
| | | | | | This provides gnome-shell with a way to use the new interface. https://bugzilla.gnome.org/show_bug.cgi?id=788851
* Ignore session IDs ending with "-xorg" under X11Olivier Tilloy2017-10-171-0/+18
| | | | | | | | | | This is done under the assumption that they are meant for Wayland only. It is expected that a session called "foo" would have a "foo.desktop" file under wayland-sessions/, a fallback "foo.desktop" under xsessions/, and another "foo-xorg.desktop" under xsessions (that may simply be a symlink to "foo.desktop") specifically for Wayland. https://bugzilla.gnome.org/show_bug.cgi?id=788552
* daemon,libgdm: allow wayland sessions with --disable-user-display-serverRay Strode2017-09-191-0/+2
| | | | | | | | | | | | Right now we hide wayland sessions from the list if the greeter isn't wayland. The greeter is never wayland if built with --disable-user-display-server. This commit allows wayland sessions for the user session, when --disable-user-display-server --enable-wayland-support is specified, even though the greeter won't use wayland itself. https://bugzilla.gnome.org/show_bug.cgi?id=787899