Skip to content

Commit

Permalink
Graceful quit greeter after start_session
Browse files Browse the repository at this point in the history
  • Loading branch information
JezerM committed Jul 13, 2024
1 parent 7adefcf commit 0b682cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/bridge/Greeter.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ def __init__(self, *args, **kwargs):
self._brightness_controller = BrightnessController()

try:
# Set Graceful finish behavior
if hasattr(LightDMGreeter, "set_finish_behavior"):
LightDMGreeter.set_finish_behavior(LightDM.GreeterFinishBehavior.GRACEFUL)

LightDMGreeter.connect_to_daemon_sync()
except GError as err:
logger.error(err)
Expand Down Expand Up @@ -370,13 +374,16 @@ def shutdown(self):

@Bridge.method(str, result=bool)
def start_session(self, session):
from PyQt5.QtCore import QCoreApplication

if not session.strip():
return False
try:
started: bool = LightDMGreeter.start_session_sync(session)
if started or self.is_authenticated:
if started:
logger.debug("Session \"%s\" started", session)
screensaver.reset_screensaver()
QCoreApplication.quit() # Quit application after start_session
return started
except GError as err:
logger.error(err)
Expand Down

0 comments on commit 0b682cd

Please sign in to comment.