Bug 368910 - Monitor change not detected on docking
Summary: Monitor change not detected on docking
Status: RESOLVED NOT A BUG
Alias: None
Product: KScreen
Classification: Plasma
Component: common (show other bugs)
Version: 5.7.95
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Sebastian Kügler
URL:
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2016-09-16 18:42 UTC by Matthias Blaicher
Modified: 2016-09-25 18:14 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Annotated kscreen log (54.36 KB, text/x-log)
2016-09-16 19:07 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-09-16 18:42:29 UTC
On a Lenovo Thinkpad L430, running Plasma 5.8 Beta with Arch Linux testing packages, monitor changes due to docking/undocking are not detected. It also had the same beviour back with Plasma 5.7. However, a simple execution of "xrandr" makes kscreen detect the monitor change. Afterwards plasmashell need to be killed and restarted to have a proper desktop layout.

This happens with the intel as well as the mode setting driver. The dock has two DVI outputs, but the problem behaves the same on both ports.

Installed packages are:

kde-unstable/plasma-workspace 5.7.95-1 
kde-unstable/kscreen 5.7.95-1
kde-unstable/libkscreen 5.7.95-1

00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)

Tomorrow, I will take the time to add propper logs to this bug report. If you require specific tests, feel free to tell me. I would also be willing to try kscreen patches.

Reproducible: Always

Steps to Reproduce:
1. Plug/Unplug laptop to dock

Actual Results:  
Nothing happens. Only detected when xrandr is executed.

Expected Results:  
Direct detection of monitor changes, proper Plasma desktop applied after screens are adjusted.
Comment 1 Matthias Blaicher 2016-09-16 19:07:30 UTC
Created attachment 101128 [details]
Annotated kscreen log

Annotated kscreen log with relevant input from journald of the folliowing sequence:

1. Boot into KDE undocked
2. Dock laptop
3. Execute xrandr
4. Close lid

While there is nothing happening in the kscreen logs, there is one entry after docking (point 2) I'd like to point out:

Sep 16 20:51:32 meinpc kwin_x11[6183]: QXcbConnection: XCB error: 3 (BadWindow), sequence: 10182, resource id: 94371848, major code: 18 (ChangeProperty), minor code: 0
Sep 16 20:51:32 meinpc kdeinit5[6147]: QObject::connect: invalid null parameter
Sep 16 20:51:32 meinpc kdeinit5[6147]: QObject::connect: invalid null parameter
Sep 16 20:51:32 meinpc kdeinit5[6147]: QObject::connect: invalid null parameter
Sep 16 20:51:32 meinpc kcminit[6975]: Initializing  "kcm_input" :  "kcminit_mouse"
Sep 16 20:51:32 meinpc kwin_x11[6183]: QXcbConnection: XCB error: 3 (BadWindow), sequence: 10561, resource id: 92274696, major code: 18 (ChangeProperty), minor code: 0 

Could it be, the ChangeProperty is the event we need, but it is dropped somehow?
Comment 2 Sebastian Kügler 2016-09-19 10:02:32 UTC
Thanks for the report, Matthias. The and information you provide (especially the annotation) is very useful. Unfortunately, I don't see how we can fix this issue, as we don't get any useful event which allows us to update the config. (The QXcbConnection BadWindow error you mention is not that useful, unfortunately.)

I'll look further into this issue and will get back to you.

Which version of xrandr are you using, by the way?
Comment 3 Matthias Blaicher 2016-09-19 10:20:51 UTC
Hi Sebastian,
thank you for your work and looking into it. As this used to work for KDE4, I suppose it is not an hardware issue, but the whole software stack and kernel changed since then...

Regarding xrandr, this is an up-to-date Arch Linux with testing enabled, so it is the libxrandr 1.5.0-1 package atm.
Comment 4 Sebastian Kügler 2016-09-19 10:46:59 UTC
Yeah, it seems to be down to a problem somewhere in the stack. I'm testing docking station (with a Lenovo X1 Yoga and a OneLine+) almost daily, and that works flawlessly now -- but there, we do actually get change events which we can react to. In your setup (hardware / software combo) that doesn't seem to be the case, so we can't really do anything (even if we know what we'd like to do).

As I said, I'm mulling over a workaround, but it doesn't look too good right now.

For kicks, could you check if this works in GNOME or Unity (maybe they've found such a workaround)?
Comment 5 linuxfluesterer 2016-09-19 15:10:16 UTC
I can confirm inability with correct recognising a direct connected monitor to my laptop, no matter on vga or HDMI. I can connect such a monitor, but after connecting I still can move the mouse pointer, but I can not execute anything with the mouse. It is not possible to open any menue, nor I receive a taskbar or else. 
When I was in menue settings for 'monitor' I could see the monitor is already recognised and displayed in the menue window. Anyway, I can not activate any menue, any program. However, when I disconnect the monitor, everthing with the build in laptop screen works fine and I can activate mouse click again.
I'm using Plasma 5.4.7 with Kernel 4.7 (Sabayon Plasma distro). I don't use XRANDR or else...

-Linuxfluesterer
Comment 6 linuxfluesterer 2016-09-19 15:26:29 UTC
I can confirm inability with correct recognising a direct connected monitor to my laptop, no matter on vga or HDMI. I can connect such a monitor, but after connecting I still can move the mouse pointer, but I can not execute anything with the mouse. It is not possible to open any menue, nor I receive a taskbar or else. 
When I was in menue settings for 'monitor' I could see the monitor is already recognised and displayed in the menue window. Anyway, I can not activate any menue, any program. However, when I disconnect the monitor, everthing with the build in laptop screen works fine and I can activate mouse click again.
I'm using Plasma 5.7.4 with Kernel 4.7 (Sabayon Plasma distro). I don't use XRANDR or else...

-Linuxfluesterer
Comment 7 Matthias Blaicher 2016-09-19 17:33:06 UTC
Hi linuxfluesterer,

I am sorry, but this is a totally unrelated bug, as you acknowledge: 

Neither is it docking related, nor does it have problems enabling your monitor (looks like a plasmashell crashes to me). Furthermore, you do not execute "xrandr", nor do you run Plasma 5.8 beta, which this bug report is explicitly about and which carries multiple multi-screen bugfixes.

If you feel like your bug has not been reported yet, feel free to open a new one specific to your issues, or wait for 5.8 Plasma to be released and check if the bug remains.

Very Best,
Matthias
Comment 8 Matthias Blaicher 2016-09-19 17:44:48 UTC
(In reply to Sebastian Kügler from comment #4)
> For kicks, could you check if this works in GNOME or Unity (maybe they've
> found such a workaround)?

I just checked - GNOME also does not work.... So I guess this bug is in the wrong tracker... Any option on how to proceed from here?
Comment 9 Matthias Blaicher 2016-09-19 18:02:49 UTC
Hi Sebastian,

it turns out, this issue was caused by a broken DVI cable... I guess it somehow impacted monitor hot-plug detection, but xrandr had an extra look on the I2C when called, and hence it was detected.

Sorry for the noise!
Comment 10 linuxfluesterer 2016-09-19 20:11:34 UTC
(In reply to Matthias Blaicher from comment #7)
> Hi linuxfluesterer,
> 
> I am sorry, but this is a totally unrelated bug, as you acknowledge: 
> 
> Neither is it docking related, nor does it have problems enabling your
> monitor (looks like a plasmashell crashes to me). Furthermore, you do not
> execute "xrandr", nor do you run Plasma 5.8 beta, which this bug report is
> explicitly about and which carries multiple multi-screen bugfixes.
> 
> If you feel like your bug has not been reported yet, feel free to open a new
> one specific to your issues, or wait for 5.8 Plasma to be released and check
> if the bug remains.
> 
> Very Best,
> Matthias

Ok, Matthias.
To be honest, I was not sure about, but for me it sounded similar a bit.
I will open a new bug report now. Thank you.

Regards.

-Linuxfluesterer
Comment 11 Sebastian Kügler 2016-09-19 21:32:25 UTC
@-Linuxfluesterer Like Matthias said, your bug is an unrelated problem, fortunately, one which we have fixed already. Your Plasma version is a bit outdated, so it doesn't contain the fix yet. It would be great if you could try Plasma 5.8 Beta to verify your problem is fixed.

Thanks for the feedback, though. :)
Comment 12 Sebastian Kügler 2016-09-19 21:35:36 UTC
@Matthias no harm done, thanks for digging into the problem. I'm glad you found the issue. :)
Comment 13 linuxfluesterer 2016-09-25 18:14:39 UTC
@Sebastian As I said, I'm using Sabayon binary distro, based on Gentoo. The Plasma environment is not upgraded to version 5.8 yet. But I assume due to the intention to ship 'stable' versions of packages, it will take some time. And, thank you for your positive) post, I look hopefully forward to upgrading my system then.

-Linuxfluesterer