Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

library: Add Session Monitor and Inhibit entry #500

Merged
merged 6 commits into from
Aug 24, 2023

Conversation

AkshayWarrier
Copy link
Contributor

@AkshayWarrier AkshayWarrier commented Aug 16, 2023

Closes #496 and closes #497

@AkshayWarrier AkshayWarrier marked this pull request as ready for review August 17, 2023 18:50
@AkshayWarrier
Copy link
Contributor Author

I have tried to replicate ASPHD demo. I tested the session inhibits for LOGOUT and IDLE and they seem to work fine, but I'm not sure how USER_SWITCH and SUSPEND is supposed to work. Whenever I try to suspend or switch user, nothing happens. I even tried comparing it to ASPHD Demo and nothing happens there either.

Also, I'm activating the session_inihibit(s) as soon as the session starts as opposed to when session-state-change is triggered. I'm not sure what's the correct method but when I try to do the latter, the inhibition always happens late and I have to logout a second time to see it.

@sonnyp
Copy link
Contributor

sonnyp commented Aug 17, 2023

nothing happens there either.

It might simply not be implemented in GNOME?

Also, I'm activating the session_inihibit(s) as soon as the session starts as opposed to when session-state-change is triggered. I'm not sure what's the correct method but when I try to do the latter, the inhibition always happens late and I have to logout a second time to see it.

Why would you wait for a session state change?

@AkshayWarrier
Copy link
Contributor Author

Why would you wait for a session state change?

It's because in multiple places the doc mentioned something like that.
https://libportal.org/enum.LoginSessionState.html

XDP_LOGIN_SESSION_QUERY_END The session is in the query end phase, during which applications can save their state or inhibit the session from ending.

https://libportal.org/method.Portal.session_monitor_query_end_response.html

This method should be called within one second of receiving a XdpPortal::session-state-changed signal with the ‘Query End’ state, to acknowledge that they have handled the state change.
Possible ways to handle the state change are either to call xdp_portal_session_inhibit() to prevent the session from ending, or to save your state and get ready for the session to end.

@sonnyp
Copy link
Contributor

sonnyp commented Aug 17, 2023

Ha, I thought it was about something else.

Hmm if ASHPD also exhibits the same problem then maybe it's a bug in the xdg portal ?

Could you open an issue on https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/issues with steps to reproduce using ASHPD?

@sonnyp
Copy link
Contributor

sonnyp commented Aug 19, 2023

For reference

image

@AkshayWarrier AkshayWarrier changed the title library: Add Session Monitor entry library: Add Session Monitor and Inhibit entry Aug 20, 2023
@sonnyp sonnyp self-assigned this Aug 21, 2023
Copy link
Contributor

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I made some small changes 6e0559f

@sonnyp sonnyp merged commit 117b559 into main Aug 24, 2023
@sonnyp sonnyp deleted the akshaywarrier/sessionmonitor branch August 24, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Session inhibit Session monitor
2 participants