Skip to content

Commit

Permalink
fix empty session issue on non-debian distributions. And load session…
Browse files Browse the repository at this point in the history
… list early
  • Loading branch information
sulincix committed Sep 17, 2024
1 parent 8fc5b30 commit e89b2c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/module/lightdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def __authentication_complete(self, greeter):
self.__show_message(greeter, _(
"Invalid session : {}").format(self.__session))
self.__session = ""
if not is_debian_based() and self.__session == "":
self.__session = self.get_session_list()[0]
try:
# Start session
if not self.greeter.start_session_sync(self.__session):
Expand Down
3 changes: 2 additions & 1 deletion src/module/sessionlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def button_event(widget):
last_session = gsettings_get("last-session")
if last_session == "" or last_session not in sessions:
last_session = sessions[0]
gsettings_set("last-session", last_session)
lightdm.set(session=last_session)
session_buttons[last_session].set_default(True)

Expand All @@ -88,7 +89,6 @@ def _session_button_event(widget):
else:
loginwindow.o("ui_icon_default_session_dd").set_from_icon_name(
"go-down-symbolic", 0)
load_sessionlist()


session_buttons = {}
Expand All @@ -98,3 +98,4 @@ def module_init():
global session_buttons
loginwindow.o("ui_button_default_session").connect(
"clicked", _session_button_event)
load_sessionlist()

0 comments on commit e89b2c7

Please sign in to comment.