Skip to content

Commit

Permalink
daemon module use login button event instead of lightdm.login()
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Nov 20, 2024
1 parent 07a2737 commit f7d2bd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/module/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def module_init():
lightdm.set(session = str(data["session"]))
GLib.idle_add(loginwindow.o("ui_entry_username").set_text, username)
GLib.idle_add(loginwindow.o("ui_entry_password").set_text, password)
lightdm.greeter.authenticate(username)
lightdm.set(username, password)
GLib.idle_add(loginwindow.event_login_button, loginwindow.o("ui_button_login"))
lightdm.login()
debug("daemon login done")
except Exception as e:
Expand Down
8 changes: 4 additions & 4 deletions src/module/gtkwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def block_delete(*args):
self.o("ui_window_main").connect("delete-event", block_delete)
self.o("ui_window_main").connect("draw", self.__draw_window)
# Login button and password entry enter
self.o("ui_button_login").connect("clicked", self.__event_login_button)
self.o("ui_button_login").connect("clicked", self.event_login_button)
self.o("ui_entry_password").connect(
"activate", self.__event_login_button)
"activate", self.event_login_button)
# password entry
self.o("ui_entry_password").connect(
"changed", self.__event_password_entry_changed)
Expand Down Expand Up @@ -267,9 +267,9 @@ def __event_password_entry_changed(self, widget):
break
# if hash and cache is equal run login event
if last_hash == hashlib.sha512(password.encode("utf-8")).hexdigest():
self.__event_login_button()
self.event_login_button()

def __event_login_button(self, widget=None):
def event_login_button(self, widget=None):
# ignore empty password if not allowed
if not get("allow-empty-password", True):
if self.o("ui_entry_password").get_text() == "":
Expand Down

0 comments on commit f7d2bd2

Please sign in to comment.