• Iain Lane's avatar
    libgdm: Remove duplicate sessions once, after all sessions have been processed · beee85a6
    Iain Lane authored
    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
    beee85a6
Name
Last commit
Last update
chooser Loading commit data...
common Loading commit data...
daemon Loading commit data...
data Loading commit data...
docs Loading commit data...
libgdm Loading commit data...
m4 Loading commit data...
pam-extensions Loading commit data...
pam_gdm Loading commit data...
po Loading commit data...
tests Loading commit data...
utils Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
HACKING Loading commit data...
MAINTAINERS Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README.md Loading commit data...
acconfig.h Loading commit data...
acinclude.m4 Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
gdm.doap Loading commit data...