xfsettingsd fails to reenable LVDS after opening lid
Submitted by Maxim Mikityanskiy
Assigned to Jérôme Guelfucci
Description
Created attachment 5899 xfsettingsd log
I use xfce4-settings 4.11.3. There is a function named xfce_displays_helper_toggle_internal() in xfsettingsd/displays.c. It should disable LVDS when lid is closed and reenable it when lid is opened. Sometimes, it fails to reenable LVDS.
Steps to reproduce:
- Start X session with xfsettingsd and some terminal emulator running. No xfce4-power-manager nor other programs that could react on lid events must be running.
- Close the lid - LVDS will be turned off by xfsettingsd.
- Switch to another VT (you could run "sleep 5; chvt 2" from root in terminal emulator before step 2).
- Open the lid.
- xfsettingsd will receive event from upower that lid is open but will fail to reenable LVDS, because VT with X session is inactive.
- Switch back to VT with X session.
- Screen is black and turned off.
- If you close and open lid again (without switching to another VT), screen is turned on again.
This bug appears on systems that run lightdm and light-locker. When I close the lid, light-locker locks the session and switches to new VT where lightdm greeter is started. Then I open the lid, enter my password into lightdm to unlock my session, lightdm switches back to old VT where my session is running, but screen is turned off. So my system renders unusable after I close and open laptop's lid.
I attach log of xfsettingsd. I closed and opened the lid two times. First time, I've just closed and opened the lid, screen was turned on after that. Second time, I've closed the lid, switched to tty1 and opened the lid - screen failed to turn on.
Attachment 5899, "xfsettingsd log":
xfsettingsd.log