Ubuntu 17.10, logs out when monitor is detached

Hej, I have a Lenovo P910 Desktop workstation running Ubuntu 17.10. Today I got surprised when disconnecting the monitor my session got logged out and all my open programs closed...

Also, even more surprising, this happens when detaching the monitor cable from the monitor, not the monitor cable from the pc...

I am using a Dell UltraSharp 25 inches monitor and a display port cable.

Any idea how to fix this? Let me know if you need any information :) Thanks! Cheers


Managed to solve this problem by installing GNOME Tweaks from the Ubuntu Software Centre.

Within GNOME Tweaks there is a 'Power' menu with the option to 'Suspend when laptop lid is closed'

Disabled this option - problem solved.

Hope this helps


You can prevent it by locking the screen first.

I have the same problem with my Desktop computer and a DVI hardware switch. Just shortly switching cause the desktop to kill all aps and relaunch.