aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-15 14:40:05 +0200
committerMihai Moldovan <ionic@ionic.de>2023-09-15 18:57:23 +0200
commitc2846982424b3bf3f2703e7a3a19b7b5f7d3611e (patch)
treee001335fc8b6c386edc6eb9795c124548b6572a0 /src
parent9faeec2e427ca0fb9316c71204ff0721e16337ed (diff)
downloadarctica-greeter-c2846982424b3bf3f2703e7a3a19b7b5f7d3611e.tar.gz
arctica-greeter-c2846982424b3bf3f2703e7a3a19b7b5f7d3611e.tar.bz2
arctica-greeter-c2846982424b3bf3f2703e7a3a19b7b5f7d3611e.zip
src/session-list.vala: Rework case-insensitive session sorting. Do the sorting on a deep copy of the session list from LightDM.
This resolves the issue of loosing all session types starting with lower case letters from the session chooser when accessing the chooser list the second time.
Diffstat (limited to 'src')
-rw-r--r--src/session-list.vala10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/session-list.vala b/src/session-list.vala
index 21e9eb6..b90c751 100644
--- a/src/session-list.vala
+++ b/src/session-list.vala
@@ -29,12 +29,6 @@ public class SessionPrompt : PromptBox
Object (id: id, session: session, default_session: default_session);
}
- private unowned GLib.List<LightDM.Session> sessions_sorted_ci (GLib.List<LightDM.Session> sessions)
- {
- sessions.sort_with_data((a, b) => GLib.strcmp (a.name.casefold(), b.name.casefold()));
- return sessions;
- }
-
private ToggleBox box;
construct
@@ -53,7 +47,9 @@ public class SessionPrompt : PromptBox
}
else
{
- foreach (var session in sessions_sorted_ci( LightDM.get_sessions() ) )
+ var sessions = LightDM.get_sessions().copy();
+ sessions.sort_with_data((a, b) => GLib.strcmp (a.name.casefold().collate_key(), b.name.casefold().collate_key()));
+ foreach (var session in sessions)
{
/* Apply hide x11/wayland filter */
if (greeter.validate_session(session.key, false) != null) {