Applet version/Build date
1.2
Cinnamon version
6.6.7
Distribution
22.3
Graphics hardware and driver used
Intel GeminiLake [UHD Graphics 600] i915 kernel
Applet name and maintainer
sessionManager@scollins @collinss
What happened?
Hello,
When using the "Switch User" function on Linux Mint with LightDM, a system notification appears stating: Execution of 'gdmflexiserver' failed. Immediately after the notification, the system falls back to the Cinnamon lock screen user switcher.
I looked into the source code and found the root cause. The display manager detection logic is misidentifying LightDM as GDM due to the order of the checks.
The code checks for GDMSESSION before checking for XDG_SEAT_PATH or the default-display-manager file:
|
//check display manager |
|
if ( GLib.getenv("MDMSESSION") ) display_manager = "mdm"; |
|
else if ( GLib.getenv("GDMSESSION") ) display_manager = "gdm"; |
|
else if ( GLib.getenv("XDG_SEAT_PATH") ) display_manager = "lightdm"; |
|
else { |
|
if ( GLib.file_test("/etc/X11/default-display-manager", GLib.FileTest.EXISTS) ) { |
|
Util.spawn_async(["grep", "-oE", "\"[^/]+$\"", "/etc/X11/default-display-manager"], Lang.bind(this, function (output) { |
|
display_manager = String(output).split("\n")[0]; |
|
})); |
|
} |
|
else { |
|
let found = false; |
|
for ( let file of ["/etc/systemd/system/display-manager.service", "/etc/systemd/system-display-manager.service"] ) { |
|
if ( GLib.file_test(file, GLib.FileTest.EXISTS) ) { |
|
found = true |
|
Util.spawn_async(["grep", "-e", "\"Exec\"", file], Lang.bind(this, function (output) { |
|
display_manager = String(output).split("/").pop().split("\n")[0]; |
|
})); |
|
} |
|
} |
|
if ( found ) global.log("Unable to determine display manager"); |
|
} |
|
} |
|
} |
On my system, the environment looks like this:
$GDMSESSION=cinnamon
$XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
cat /etc/X11/default-display-manager # returns /usr/sbin/lightdm
Because the LightDM/Cinnamon session populates GDMSESSION=cinnamon for legacy compatibility:
https://github.com/ubuntu/lightdm/blob/5f14752419fc7f0fd763013c8195dcb0099c940a/src/seat.c#L996
the else if ( GLib.getenv("GDMSESSION") ) check passes first. The applet sets display_manager = "gdm" and subsequently tries to execute gdmflexiserver when switching users, causing the error notification.
Proposed Solution:
Reordering the conditional block to check /etc/X11/default-display-manager or XDG_SEAT_PATH before GDMSESSION would correctly identify LightDM, at least in my system, allowing the applet to use the proper dm-tool switch-to-greeter command natively.
Other information
No response
Applet version/Build date
1.2
Cinnamon version
6.6.7
Distribution
22.3
Graphics hardware and driver used
Intel GeminiLake [UHD Graphics 600] i915 kernel
Applet name and maintainer
sessionManager@scollins @collinss
What happened?
Hello,
When using the "Switch User" function on Linux Mint with LightDM, a system notification appears stating:
Execution of 'gdmflexiserver' failed. Immediately after the notification, the system falls back to the Cinnamon lock screen user switcher.I looked into the source code and found the root cause. The display manager detection logic is misidentifying LightDM as GDM due to the order of the checks.
The code checks for
GDMSESSIONbefore checking forXDG_SEAT_PATHor thedefault-display-managerfile:cinnamon-spices-applets/sessionManager@scollins/files/sessionManager@scollins/applet.js
Lines 187 to 210 in 6a81d6c
On my system, the environment looks like this:
Because the LightDM/Cinnamon session populates
GDMSESSION=cinnamonfor legacy compatibility:https://github.com/ubuntu/lightdm/blob/5f14752419fc7f0fd763013c8195dcb0099c940a/src/seat.c#L996
the
else if ( GLib.getenv("GDMSESSION") )check passes first. The applet setsdisplay_manager = "gdm"and subsequently tries to executegdmflexiserverwhen switching users, causing the error notification.Proposed Solution:
Reordering the conditional block to check
/etc/X11/default-display-managerorXDG_SEAT_PATHbeforeGDMSESSIONwould correctly identify LightDM, at least in my system, allowing the applet to use the properdm-tool switch-to-greetercommand natively.Other information
No response