workbenchdev / demos

Demos of GNOME technologies - GTK, libadwaita, CSS, portals, ...
Creative Commons Zero v1.0 Universal
10 stars 16 forks source link

Port 'Session Monitor and Inhibit' to Vala #176

Closed BharatAtbrat closed 3 months ago

BharatAtbrat commented 3 months ago

Added Vala code for Session Monitor and Inhibit

I don't know how to test this demo (I'd be grateful for more information about what this demo does )

Let me know if there are any changes/ issues with the code :)

Diego-Ivan commented 3 months ago

I don't know how to test this demo (I'd be grateful for more information about what this demo does)

By inhibiting a session, you warn about (and prevent) the user terminating a running session while the program that is doing something important. GNOME Shell displays that warning like this:

Captura desde 2024-06-12 17-55-38

When the session is finishing (i.e, when the user wants to power off, restart their computer or log out of their session) the app that is inhibiting the session will be notified, so it saves unsaved progress, safely cancels a running operation, or other actions that may require a more graceful shutdown. After finishing said task, it can uninhibit the session so the user can terminate it. You can test this option by trying to log out of your session or trying to power off you system.

In the case you enable the Idle option, it will prevent the system from going idle (the screen going dark after not moving the mouse after a long time). This option is very useful for games and video apps!

BharatAtbrat commented 3 months ago

I don't know how to test this demo (I'd be grateful for more information about what this demo does)

By inhibiting a session, you warn about (and prevent) the user terminating a running session while the program that is doing something important. GNOME Shell displays that warning like this:

Captura desde 2024-06-12 17-55-38

When the session is finishing (i.e, when the user wants to power off, restart their computer or log out of their session) the app that is inhibiting the session will be notified, so it saves unsaved progress, safely cancels a running operation, or other actions that may require a more graceful shutdown. After finishing said task, it can uninhibit the session so the user can terminate it. You can test this option by trying to log out of your session or trying to power off you system.

In the case you enable the Idle option, it will prevent the system from going idle (the screen going dark after not moving the mouse after a long time). This option is very useful for games and video apps!

Understood. Thank you very much! :)