Bug 363238 - Docked laptop lid close does not enable external monitor
Summary: Docked laptop lid close does not enable external monitor
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: libkscreen (show other bugs)
Version: 5.6.4
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-18 20:30 UTC by Matthias Blaicher
Modified: 2016-08-22 11:07 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Logs collected by systemd (17.07 KB, text/plain)
2016-05-18 20:31 UTC, Matthias Blaicher
Details
kscreen monitor output until crash (8.09 KB, text/plain)
2016-05-18 20:32 UTC, Matthias Blaicher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Blaicher 2016-05-18 20:30:17 UTC
I have two available displays on a laptop with Intel gfx:
- Enabled Panel (LVDS1), id 67, 1600x900
- Disabled External Display (HDMI2), id 72, 2048x1152

Wen closing the lid, I'd expect the external monitor to get active, instead it tries to enable a config without any monitor and gives up on that. A kscreen-console runing in parallel crashes inside libKF5Screen (KScreen::Output::name()).

I've attached debug logs. Feel free to let me test patches etc.

Reproducible: Always

Steps to Reproduce:
1. Laptop docked, panel enabled
2. Close Lid


Actual Results:  
Nothing happens, libkscreen crashes

Expected Results:  
Move to target monitor.
Comment 1 Matthias Blaicher 2016-05-18 20:31:14 UTC
Created attachment 99059 [details]
Logs collected by systemd
Comment 2 Matthias Blaicher 2016-05-18 20:32:16 UTC
Created attachment 99060 [details]
kscreen monitor output until crash
Comment 3 Sebastian Kügler 2016-05-23 08:07:46 UTC
Thanks for the report!

Would it be possible to run kscreen-monitor in gdb and reproduce the crash? I'd be highly interested in the backtrace.
Comment 4 José Pekkarinen 2016-05-27 09:50:11 UTC
Hi,

Also, if you start the machine in the docker, with the lid already closed, the composer shows both screens active, though obviously you don't see laptop screen. This comes to a trouble when some windows turn up in the other screen.

Thanks!
Comment 5 Sebastian Kügler 2016-08-16 23:51:31 UTC
Matthias, would it be possible for you to test the current development version of Plasma (git master)?

We've fixed a number of bugs that prevented enabling newly connected displays correctly, so it's quite likely that this particular problem doesn't exist anymore. I can't reproduce it on my systems here with git master.
Comment 6 Matthias Blaicher 2016-08-17 06:49:34 UTC
Yes, indeed. I have seen your recent activity and that laptop is already running kscreen git as of 4-5 days ago. Unfortunately, the laptop still has issues detecting changes in monitors while docking (only discovered upon the first xrandr call on command line). This occurs both with the intel as well as with the modesetting driver. It might very well be a kernel driver issue?

Since it is not my personal laptop I haven't investigated further, I'll try to have a look next weekend again.
Comment 7 Matthias Blaicher 2016-08-20 09:52:53 UTC
I cannot reproduce this bug anymore with latest git, since the Laptop now goes to sleep - even though its on AC power and docked, while the second monitor is connected. Stupid, but hey....
Comment 8 Sebastian Kügler 2016-08-22 10:38:49 UTC
You can tell it not to suspend in Systemsettings | Power Management | Button Events handling. There's a checkbox that allows to not suspend when the lid is closed and an external monitor is connected.
Comment 9 Matthias Blaicher 2016-08-22 10:46:53 UTC
(In reply to Sebastian Kügler from comment #8)
> You can tell it not to suspend in Systemsettings | Power Management | Button
> Events handling. There's a checkbox that allows to not suspend when the lid
> is closed and an external monitor is connected.

Yes, but in this case, the external monitor is initially disabled and I expect it to switch to it once the lid is closed. In this case, suspend was not suppressed. I had to disable logind suspend events to make it work...
Comment 10 Sebastian Kügler 2016-08-22 11:07:52 UTC
So you want to switch layouts when the lid closes from only laptop screen enabled to only external enabled?

That sounds kind of weird to me. You can achieve the same by just having the external screen connected or not, doing it when the lid closes seems counter-intuitive to me. Aside from that, I wouldn't know how to present it in the UI.