Update SurfaceInterface outputs when an output global gets destroyed
ClosedPublic

Authored by davidedmundson on Aug 24 2017, 11:32 PM.

Details

Summary

As per existing TODO.

A new signal is added on Global to emit so we can process the result
whist we still have a valid object. The name is overly explicit to try
and logically separate it from QObject::destroyed().

Test Plan

Updated existing unit test.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
anthonyfieroni added inline comments.
src/server/surface_interface.cpp
814

UniqueConnection with lambda ?

graesslin added inline comments.
src/server/surface_interface.cpp
814

Yeah, I don't think unique will work here. But looking at the code it also doesn't matter if the lambda is executed multiple times.

Update connections better

Restricted Application edited projects, added Plasma; removed Plasma on Wayland. · View Herald TranscriptAug 25 2017, 10:11 AM
Restricted Application edited projects, added Plasma on Wayland; removed Plasma. · View Herald TranscriptAug 25 2017, 10:13 AM
graesslin accepted this revision.Aug 25 2017, 1:13 PM
This revision is now accepted and ready to land.Aug 25 2017, 1:13 PM

Could you please push this change, it fixes a crash in KWin when changing outputs (as discovered by PlasmaSurfaceTest::testOSDPlacement()):

Thread 1 "testPlasmaSurfa" received signal SIGSEGV, Segmentation fault.
KWayland::Server::OutputInterface::clientResources (this=<optimized out>, client=0x790460) at /workspace/build/src/server/output_interface.cpp:514
514     /workspace/build/src/server/output_interface.cpp: No such file or directory.
(gdb) bt
#0  KWayland::Server::OutputInterface::clientResources (this=<optimized out>, client=0x790460) at /workspace/build/src/server/output_interface.cpp:514
#1  0x00007ffff6f59d87 in KWayland::Server::SurfaceInterface::setOutputs (this=<optimized out>, outputs=...)
    at /workspace/build/src/server/surface_interface.cpp:792
#2  0x00007ffff7acbb4d in KWin::ShellClient::updateClientOutputs (this=0x78c710) at /home/martin/src/kde/workspace/kwin/shell_client.cpp:1540
#3  0x00007ffff5784f46 in QtPrivate::QSlotObjectBase::call (a=0x7fffffffcc10, r=0x78c710, this=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:101
#4  QMetaObject::activate (sender=0x6c8e40, signalOffset=<optimized out>, local_signal_index=<optimized out>, argv=<optimized out>)
    at kernel/qobject.cpp:3749
#5  0x00007ffff5785c59 in QObject::event (this=0x6c8e40, e=<optimized out>) at kernel/qobject.cpp:1246
#6  0x00007ffff62e23fc in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x6c8e40, e=0x7e6ed0) at kernel/qapplication.cpp:3717
#7  0x00007ffff62e9e07 in QApplication::notify (this=0x7fffffffdd80, receiver=0x6c8e40, e=0x7e6ed0) at kernel/qapplication.cpp:3476
#8  0x00007ffff5758798 in QCoreApplication::notifyInternal2 (receiver=0x6c8e40, event=event@entry=0x7e6ed0) at kernel/qcoreapplication.cpp:1018
#9  0x00007ffff575af7b in QCoreApplication::sendEvent (event=0x7e6ed0, receiver=<optimized out>)
    at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:233
#10 QCoreApplicationPrivate::sendPostedEvents (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x641710)
    at kernel/qcoreapplication.cpp:1678
#11 0x00007ffff57aa7e7 in QEventDispatcherUNIX::processEvents (this=0x657e20, flags=...) at kernel/qeventdispatcher_unix.cpp:466
#12 0x00007fffdfe02ced in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /home/martin/build/kde/workspace/kwin/bin/KWinQpaPlugin.so
#13 0x00007ffff57567ca in QEventLoop::exec (this=this@entry=0x7fffffffd100, flags=..., flags@entry=...) at kernel/qeventloop.cpp:212
#14 0x0000000000412034 in QTestEventLoop::enterLoopMSecs (ms=5000, this=0x7fffffffd1c8) at /usr/include/x86_64-linux-gnu/qt5/QtTest/qtesteventloop.h:105
#15 QSignalSpy::wait (this=0x7fffffffd1a0, timeout=5000) at /usr/include/x86_64-linux-gnu/qt5/QtTest/qsignalspy.h:149
---Type <return> to continue, or q <return> to quit---
#16 0x000000000040e5db in PlasmaSurfaceTest::testOSDPlacement (this=<optimized out>)
    at /home/martin/src/kde/workspace/kwin/autotests/integration/plasma_surface_test.cpp:233
#17 0x00007ffff57642d6 in QMetaMethod::invoke (this=<optimized out>, object=0x7fffffffdd50, connectionType=Qt::DirectConnection, returnValue=..., 
    val0=..., val1=..., val2=..., val3=..., val4=..., val5=..., val6=..., val7=..., val8=..., val9=...) at kernel/qmetaobject.cpp:2222
#18 0x00007ffff7fa4f2c in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Test.so.5
#19 0x00007ffff7fa5876 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Test.so.5
#20 0x00007ffff7fa5ea2 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Test.so.5
#21 0x00007ffff7fa6389 in QTest::qExec(QObject*, int, char**) () from /usr/lib/x86_64-linux-gnu/libQt5Test.so.5
#22 0x0000000000409521 in main (argc=1, argv=0x7fffffffdf18) at /home/martin/src/kde/workspace/kwin/autotests/integration/plasma_surface_test.cpp:404
This revision was automatically updated to reflect the committed changes.