linuxmint / cinnamon-session

The Cinnamon session manager
GNU General Public License v2.0
26 stars 36 forks source link

Cinnamon creates a `block` systemd inhibitor when a user application creates `delay` inhibitor #147

Open kolayne opened 2 years ago

kolayne commented 2 years ago
 * Cinnamon 5.0.5
 * Mint 20.2
 * Intel UHD Graphics 630 with NVidia GeForce GTX 1650 Mobile, nvidia-driver-470 470.42.01
 * 64 bit

Issue I have an application /usr/bin/vk, which sets a delay systems inhibitor against suspension. For some reason, cinnamon-session adds an additional (block!) inhibitor for both suspension and shutdown and removes it as soon as I exit vk.

Output of systemd-inhibit when the application is not running:

WHO            UID  USER    PID  COMM           WHAT                                                     WHY                                       MODE 
ModemManager   0    root    898  ModemManager   sleep                                                    ModemManager needs to reset devices       delay
NetworkManager 0    root    776  NetworkManager sleep                                                    NetworkManager needs to turn off networks delay
UPower         0    root    2882 upowerd        sleep                                                    Pause device polling                      delay
nikolay        1000 nikolay 6866 csd-power      handle-lid-switch                                        Multiple displays attached                block
nikolay        1000 nikolay 6887 csd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key Cinnamon handling keypresses              block
nikolay        1000 nikolay 6866 csd-power      sleep                                                    Cinnamon needs to lock the screen         delay

6 inhibitors listed.

Output of systemd-inhibit when the application is running:

WHO            UID  USER    PID   COMM            WHAT                                                     WHY                                       MODE 
ModemManager   0    root    898   ModemManager    sleep                                                    ModemManager needs to reset devices       delay
NetworkManager 0    root    776   NetworkManager  sleep                                                    NetworkManager needs to turn off networks delay
UPower         0    root    2882  upowerd         sleep                                                    Pause device polling                      delay
nikolay        1000 nikolay 6866  csd-power       handle-lid-switch                                        Multiple displays attached                block
nikolay        1000 nikolay 6887  csd-media-keys  handle-power-key:handle-suspend-key:handle-hibernate-key Cinnamon handling keypresses              block
nikolay        1000 nikolay 6752  cinnamon-sessio shutdown:sleep                                           user session inhibited                    block
nikolay        1000 nikolay 6866  csd-power       sleep                                                    Cinnamon needs to lock the screen         delay
vk             1000 nikolay 24169 vk              sleep                                                    Application cleanup before suspend        delay

8 inhibitors listed.

This results in my laptop being unable to suspend when inactive. Also, I have tried doing systemctl suspend. It works fine when vk is closed, but gives the following error when it is running:

Operation inhibited by "nikolay" (PID 6752 "cinnamon-sessio", user nikolay), reason is "user session inhibited".

Steps to reproduce

  1. Open an application that creates a delay inhibitor for suspension (for example, /usr/bin/vk. Something similar seems to happen with some component(s) of Steam), but creates no block inhibitors and no shutdown inhibitors

Expected behaviour Either no inhibitors are created by cinnamon-session, or, in case it has something additional it needs to clean up, a delay inhibitor of suspension is added