Bug 343772

Summary: Blank screen encountered on disconnecting secondary screen
Product: [Plasma] plasmashell Reporter: R.Harish Navnit <harishnavnit>
Component: generic-multiscreenAssignee: Aleix Pol <aleixpol>
Status: RESOLVED DUPLICATE    
Severity: grave CC: christoph, harishnavnit, jjhuff, kde, krissn, lutz.wrage, Martin, nadavkav, nate, null
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
URL: https://drive.google.com/folderview?id=0Bxf5QIFnNjVeTDdiTG9MNHFfcGM&usp=sharing
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Pasting the complete attachment

Description R.Harish Navnit 2015-02-04 13:55:01 UTC
After disconnecting an external monitor(secondary screen), even the primary display goes blank. This gives the user no clues as to what is happening. The worst part being that the problem persists even after rebooting and there's apparently no way to get rid of it. 

Reproducible: Always

Steps to Reproduce:
1. Connect an external screen.
2. Disable the primary screen, continue working on the primary screen.
3. Disconnect the external screen.

Actual Results:  
The primary screen goes blank ! 

Expected Results:  
The primary screen should be active once the external screen is disconnected.

Backtrace obtained on kubuntu 14.10(ppa:kubuntu/ci) 

Steps to Reproduce:
1. Connect to an external screen.
2. Disable the primary screen, keep working on the secondary screen.
3. Disconnect the external screen.

Thread 1 (Thread 0x7ffff7e48880 (LWP 19845)):
#0  QScreen::handle (this=this@entry=0x0) at kernel/qscreen.cpp:85
#1  0x00007fffe64befc2 in QXcbNativeInterface::nativeResourceForScreen (this=<optimized out>, resource=..., screen=0x0) at qxcbnativeinterface.cpp:257
#2  0x00007ffff7f4c9bb in QX11Info::display() () from /usr/lib/x86_64-linux-gnu/libQt5X11Extras.so.5
#3  0x00000000004456dc in PanelShadows::Private::clearShadow (window=0xa9fe40, this=<optimized out>) at ../../shell/panelshadows.cpp:493
#4  0x0000000000448445 in clearShadow (window=<optimized out>, this=<optimized out>) at ../../shell/panelshadows.cpp:147
#5  PanelShadows::removeWindow (this=0x697aa0 <(anonymous namespace)::Q_QGS_privateDialogShadowsSelf::innerFunction()::holder>, window=window@entry=0xa9fe40)
    at ../../shell/panelshadows.cpp:142
#6  0x000000000043facf in PanelView::~PanelView (this=0xa9fe40, __in_chrg=<optimized out>) at ../../shell/panelview.cpp:124
#7  0x000000000043fb49 in PanelView::~PanelView (this=0xa9fe40, __in_chrg=<optimized out>) at ../../shell/panelview.cpp:125
#8  0x000000000044f4c4 in ShellCorona::removeView (this=0x700770, idx=0) at ../../shell/shellcorona.cpp:695
#9  0x000000000044f549 in ShellCorona::screenRemoved (this=0x700770, screen=<optimized out>) at ../../shell/shellcorona.cpp:728
#10 0x00007ffff352efea in call (a=0x7fffffffdf80, r=0x700770, this=0x9be270) at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124
#11 QMetaObject::activate (sender=0x7fffffffea00, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7fffffffdf80)
    at kernel/qobject.cpp:3702
#12 0x00007ffff352fce7 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff3c8e900 <QGuiApplication::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7fffffffdf80) at kernel/qobject.cpp:3582
#13 0x00007ffff383f5e2 in QGuiApplication::screenRemoved (this=<optimized out>, _t1=_t1@entry=0x6c69b0) at .moc/moc_qguiapplication.cpp:328
#14 0x00007ffff386efe9 in QScreen::~QScreen (this=0x6c69b0, __in_chrg=<optimized out>) at kernel/qscreen.cpp:76
#15 0x00007ffff386f009 in QScreen::~QScreen (this=0x6c69b0, __in_chrg=<optimized out>) at kernel/qscreen.cpp:77
#16 0x00007ffff3836a42 in QPlatformScreen::~QPlatformScreen (this=0x6c69d0, __in_chrg=<optimized out>) at kernel/qplatformscreen.cpp:57
#17 0x00007fffe64b33a9 in QXcbScreen::~QXcbScreen (this=0x6c69d0, __in_chrg=<optimized out>) at qxcbscreen.cpp:211
#18 0x00007fffe64a63f7 in QXcbConnection::updateScreens (this=this@entry=0x6b8b90) at qxcbconnection.cpp:286
#19 0x00007fffe64a70bd in QXcbConnection::handleXcbEvent (this=this@entry=0x6b8b90, event=event@entry=0x7fffdc00a6f0) at qxcbconnection.cpp:955
#20 0x00007fffe64a835b in QXcbConnection::processXcbEvents (this=0x6b8b90) at qxcbconnection.cpp:1297
#21 0x00007ffff35307ba in QObject::event (this=0x6b8b90, e=<optimized out>) at kernel/qobject.cpp:1245
#22 0x00007ffff3dfed3c in QApplicationPrivate::notify_helper (this=0x6ae220, receiver=0x6b8b90, e=0x7fffdc00a8e0) at kernel/qapplication.cpp:3722
#23 0x00007ffff3e04330 in QApplication::notify (this=0x7fffffffea00, receiver=0x6b8b90, e=0x7fffdc00a8e0) at kernel/qapplication.cpp:3505
#24 0x00007ffff350003b in QCoreApplication::notifyInternal (this=0x7fffffffea00, receiver=0x6b8b90, event=event@entry=0x7fffdc00a8e0) at kernel/qcoreapplication.cpp:932
#25 0x00007ffff350207b in sendEvent (event=0x7fffdc00a8e0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:228
#26 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x6a5100) at kernel/qcoreapplication.cpp:1536
#27 0x00007ffff3502678 in QCoreApplication::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1394
#28 0x00007ffff3556e83 in postEventSourceDispatch (s=0x6dd350) at kernel/qeventdispatcher_glib.cpp:271
#29 0x00007fffef577c5d in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x00007fffef577f48 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007fffef577ffc in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007ffff3557277 in QEventDispatcherGlib::processEvents (this=0x6dcf20, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#33 0x00007ffff34fd8d2 in QEventLoop::exec (this=this@entry=0x7fffffffe8a0, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#34 0x00007ffff350537c in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1185
#35 0x00007ffff3840bcc in QGuiApplication::exec () at kernel/qguiapplication.cpp:1535
#36 0x00007ffff3dfadf5 in QApplication::exec () at kernel/qapplication.cpp:2956
#37 0x000000000042fcaf in main (argc=1, argv=<optimized out>) at ../../shell/main.cpp:150
Comment 1 R.Harish Navnit 2015-02-04 13:58:37 UTC
Created attachment 90909 [details]
Pasting the complete attachment

Sorry about the earlier one, here are the proper steps to obtain the backtrace

1. Kill(all) plasmashell
2. switch to vt
3. run plasmashell in gdb
4. disconnect the external monitor once plasmashell loads
5. retrieve the backtrace from gdb
Comment 2 David Edmundson 2015-03-22 19:58:39 UTC
What version of Qt are you using?

Is there still a primary screen attached?
Comment 3 R.Harish Navnit 2015-03-23 03:52:40 UTC
(In reply to David Edmundson from comment #2)
> What version of Qt are you using?
Qt version 5.4.0

> 
> Is there still a primary screen attached?
Not sure what you mean. My primary display here would be my laptop's screen(which is obviously attached).
Comment 4 David Edmundson 2015-03-23 09:23:14 UTC
Thanks
Comment 5 Nadav Kavalerchik 2015-04-26 09:00:45 UTC
I confirm I have the same bug. 
Which started to happen immediately  after upgrading from Kubuntu 14.10 to 15.04
Comment 6 Nadav Kavalerchik 2015-04-26 09:03:26 UTC
I use a thinkpad t440s + a docking station. So the external screen is physically connected to the docking station (digital) input.
Comment 7 Krzysztof Nowicki 2015-07-07 08:41:55 UTC
Looks like this may have been a Qt bug that was fixed for 5.5 (https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=commit;h=a1b84fe729d7ccf4c1469d35d0793b45034d5fd6)
Comment 8 R.Harish Navnit 2015-07-07 10:18:45 UTC
Yes. I was told at the time that this was a bug with Qt. I'll close this if this issue isn't reproducible anymore :)
Comment 9 Unknown 2015-08-01 12:22:21 UTC
I want to throw my two cents.
I have a dell latitude E6430s with Kubuntu 15.04 and Opensuse Tumbleweed, both with plasma 5.3.
At work I connect it to a second screen via a docking station. I connect and disconnect my laptop always when sleeping or powered off.

Usually it connect without issues (although sometimes it takes a while to realize that there is an external monitor). After disconnecting, most of the time I get a black screen with just the mouse pointers. The only ways that I've found get the screen back are:
* reboot
* sudo systemctl restart display-manager.service
* resetting the screen with xrandr (via an ssh connection)

I don't remember seeing this problem when after connecting my laptop to a projector with a vga cable.

Do you know when we can expect to see this problem fixed?
Comment 10 Christoph Cullmann 2015-10-05 12:07:44 UTC
It is a known problem with Qt:

https://bugreports.qt.io/browse/QTBUG-42985

Unfixed, please report any more info to the Qt bugtracker.
Comment 11 Nate Graham 2021-02-08 19:28:20 UTC

*** This bug has been marked as a duplicate of bug 341497 ***