mirror of
https://github.com/fairyglade/ly.git
synced 2026-02-04 08:24:55 +00:00
Fix wrong session being chosen in autologin (closes #911)
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
@@ -1300,14 +1300,14 @@ fn isValidUsername(username: []const u8, usernames: StringList) bool {
|
||||
|
||||
fn findSessionByName(session: *Session, name: []const u8) ?usize {
|
||||
for (session.label.list.items, 0..) |env, i| {
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.file_name, name)) return i;
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.name, name)) return i;
|
||||
if (env.environment.xdg_session_desktop) |session_desktop| {
|
||||
if (session_desktop.len > 0 and std.ascii.eqlIgnoreCase(session_desktop, name)) return i;
|
||||
}
|
||||
if (env.environment.xdg_desktop_names) |session_desktop_name| {
|
||||
if (std.ascii.eqlIgnoreCase(session_desktop_name, name)) return i;
|
||||
}
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.name, name)) return i;
|
||||
if (std.ascii.eqlIgnoreCase(env.environment.file_name, name)) return i;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user