Do not produce negative struts on switching screens

Review Request #126216 - Created Dec. 1, 2015 and submitted

Information
Jan Kundrát
plasma-workspace
master
0059d87...
Reviewers
plasma
graesslin
Turns out that this method is sometimes called at the time where the
virtualGeometry() is invalid. Rather than producing values which are
surely invalid, try to come up with something which might be incorrect
on some multiscreen setups (right?), but which at least happens to work
on my setup.
Here's how the stack traces look like BTW:

389     /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp: No such file or directory.
(gdb) bt
#0  PanelView::positionPanel (this=0x555558162660) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:389
#1  0x000055555559e6a9 in PanelView::containmentChanged (this=0x555558162660) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:1036
#2  0x000055555559fdf5 in PanelView::qt_static_metacall (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>)
    at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999_build/shell/moc_panelview.cpp:224
#3  0x00007ffff2bbbf79 in QMetaObject::activate (sender=0x555558162660, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x0)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3713
#4  0x00007ffff2bbc6d5 in QMetaObject::activate (sender=<optimized out>, m=m@entry=0x7ffff7bd0600 <PlasmaQuick::ContainmentView::staticMetaObject>, 
    local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x0) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3578
#5  0x00007ffff79ab309 in PlasmaQuick::ContainmentView::containmentChanged (this=<optimized out>)
    at /var/tmp/portage/kde-frameworks/plasma-9999/work/plasma-9999_build/src/plasmaquick/moc_containmentview.cpp:257
#6  0x00007ffff79abdf0 in PlasmaQuick::ContainmentViewPrivate::setContainment (this=0x555558225fb0, cont=0x555555da3270)
    at /var/tmp/portage/kde-frameworks/plasma-9999/work/plasma-9999/src/plasmaquick/containmentview.cpp:96
#7  0x00007ffff79ac5df in PlasmaQuick::ContainmentView::setContainment (this=this@entry=0x555558162660, cont=<optimized out>)
    at /var/tmp/portage/kde-frameworks/plasma-9999/work/plasma-9999/src/plasmaquick/containmentview.cpp:246
#8  0x00005555555b08ab in ShellCorona::createWaitingPanels (this=0x5555558c6790) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/shellcorona.cpp:1023
#9  0x00007ffff2bbba00 in call (a=0x7fffffffce10, r=0x5555558c6790, this=0x5555558df440) at ../../include/QtCore/../../../qtcore-5.5.9999/src/corelib/kernel/qobject_impl.h:124
#10 QMetaObject::activate (sender=sender@entry=0x5555558c6840, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3698
#11 0x00007ffff2bbc6d5 in QMetaObject::activate (sender=sender@entry=0x5555558c6840, m=m@entry=0x7ffff2dd84a0 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x0) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3578
#12 0x00007ffff2c47016 in QTimer::timeout (this=this@entry=0x5555558c6840) at .moc/moc_qtimer.cpp:197
#13 0x00007ffff2bca552 in QTimer::timerEvent (this=0x5555558c6840, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qtimer.cpp:247
#14 0x00007ffff2bbd2b4 in QObject::event (this=0x5555558c6840, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:1220
#15 0x00007ffff3672c1c in QApplicationPrivate::notify_helper (this=this@entry=0x555555810f70, receiver=receiver@entry=0x5555558c6840, e=e@entry=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3716
#16 0x00007ffff367847a in QApplication::notify (this=0x7fffffffd670, receiver=0x5555558c6840, e=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3499
#17 0x00007ffff2b8c57d in QCoreApplication::notifyInternal (this=0x7fffffffd670, receiver=0x5555558c6840, event=event@entry=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:965
#18 0x00007ffff2be60cc in sendEvent (event=0x7fffffffd240, receiver=<optimized out>) at ../../include/QtCore/../../../qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.h:224
#19 QTimerInfoList::activateTimers (this=0x55555584b370) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qtimerinfo_unix.cpp:637
#20 0x00007ffff2be6713 in timerSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:177
#21 idleTimerSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:224
#22 0x00007fffee2d82a9 in g_main_dispatch (context=0x7fffe0002450) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3111
#23 g_main_context_dispatch (context=context@entry=0x7fffe0002450) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3710
#24 0x00007fffee2d8538 in g_main_context_iterate (context=context@entry=0x7fffe0002450, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3781
#25 0x00007fffee2d8641 in g_main_context_iteration (context=0x7fffe0002450, may_block=1) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3842
#26 0x00007ffff2be6ba1 in QEventDispatcherGlib::processEvents (this=0x555555852c60, flags=...)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:418
#27 0x00007ffff2b8aa8b in QEventLoop::exec (this=this@entry=0x7fffffffd4e0, flags=..., flags@entry=...)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventloop.cpp:204
#28 0x00007ffff2b93018 in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:1229
#29 0x000055555558a55b in main (argc=1, argv=<optimized out>) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/main.cpp:179
(gdb) c
Continuing.

Breakpoint 4, PanelView::positionPanel (this=0x555558162660) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:389
389     in /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp
(gdb) bt
#0  PanelView::positionPanel (this=0x555558162660) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:389
#1  0x000055555559e8c5 in PanelView::setThickness (this=0x555558162660, value=40) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:223
#2  0x000055555559f477 in PanelView::restore (this=0x555558162660) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:514
#3  0x000055555559fafc in operator() (__closure=<synthetic pointer>) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:81
#4  call (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:495
#5  call<QtPrivate::List<>, void> (arg=<optimized out>, f=...) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:552
#6  QtPrivate::QFunctorSlotObject<PanelView::PanelView(ShellCorona*, QScreen*, QWindow*)::__lambda1, 0, QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=<optimized out>, this_=<optimized out>, r=<optimized out>, a=<optimized out>, ret=<optimized out>) at /usr/include/qt5/QtCore/qobject_impl.h:192
#7  0x00007ffff2bbba00 in call (a=0x7fffffffce10, r=0x555558162660, this=0x555555eefd80) at ../../include/QtCore/../../../qtcore-5.5.9999/src/corelib/kernel/qobject_impl.h:124
#8  QMetaObject::activate (sender=sender@entry=0x555558162708, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3698
#9  0x00007ffff2bbc6d5 in QMetaObject::activate (sender=sender@entry=0x555558162708, m=m@entry=0x7ffff2dd84a0 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x0) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3578
#10 0x00007ffff2c47016 in QTimer::timeout (this=this@entry=0x555558162708) at .moc/moc_qtimer.cpp:197
#11 0x00007ffff2bca552 in QTimer::timerEvent (this=0x555558162708, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qtimer.cpp:247
#12 0x00007ffff2bbd2b4 in QObject::event (this=0x555558162708, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:1220
#13 0x00007ffff3672c1c in QApplicationPrivate::notify_helper (this=this@entry=0x555555810f70, receiver=receiver@entry=0x555558162708, e=e@entry=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3716
#14 0x00007ffff367847a in QApplication::notify (this=0x7fffffffd670, receiver=0x555558162708, e=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3499
#15 0x00007ffff2b8c57d in QCoreApplication::notifyInternal (this=0x7fffffffd670, receiver=0x555558162708, event=event@entry=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:965
#16 0x00007ffff2be60cc in sendEvent (event=0x7fffffffd240, receiver=<optimized out>) at ../../include/QtCore/../../../qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.h:224
#17 QTimerInfoList::activateTimers (this=0x55555584b370) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qtimerinfo_unix.cpp:637
#18 0x00007ffff2be66af in timerSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:177
#19 0x00007fffee2d82a9 in g_main_dispatch (context=0x7fffe0002450) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3111
#20 g_main_context_dispatch (context=context@entry=0x7fffe0002450) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3710
#21 0x00007fffee2d8538 in g_main_context_iterate (context=context@entry=0x7fffe0002450, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3781
#22 0x00007fffee2d8641 in g_main_context_iteration (context=0x7fffe0002450, may_block=1) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3842
#23 0x00007ffff2be6ba1 in QEventDispatcherGlib::processEvents (this=0x555555852c60, flags=...)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:418
#24 0x00007ffff2b8aa8b in QEventLoop::exec (this=this@entry=0x7fffffffd4e0, flags=..., flags@entry=...)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventloop.cpp:204
#25 0x00007ffff2b93018 in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:1229
#26 0x000055555558a55b in main (argc=1, argv=<optimized out>) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/main.cpp:179
(gdb) c
Continuing.

Breakpoint 4, PanelView::positionPanel (this=0x555558162660) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:389
389     in /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp
(gdb) bt
#0  PanelView::positionPanel (this=0x555558162660) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/panelview.cpp:389
#1  0x00007ffff2bbba00 in call (a=0x7fffffffce10, r=0x555558162660, this=0x555555eefd80) at ../../include/QtCore/../../../qtcore-5.5.9999/src/corelib/kernel/qobject_impl.h:124
#2  QMetaObject::activate (sender=sender@entry=0x555558162708, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3698
#3  0x00007ffff2bbc6d5 in QMetaObject::activate (sender=sender@entry=0x555558162708, m=m@entry=0x7ffff2dd84a0 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, 
    argv=argv@entry=0x0) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:3578
#4  0x00007ffff2c47016 in QTimer::timeout (this=this@entry=0x555558162708) at .moc/moc_qtimer.cpp:197
#5  0x00007ffff2bca552 in QTimer::timerEvent (this=0x555558162708, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qtimer.cpp:247
#6  0x00007ffff2bbd2b4 in QObject::event (this=0x555558162708, e=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qobject.cpp:1220
#7  0x00007ffff3672c1c in QApplicationPrivate::notify_helper (this=this@entry=0x555555810f70, receiver=receiver@entry=0x555558162708, e=e@entry=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3716
#8  0x00007ffff367847a in QApplication::notify (this=0x7fffffffd670, receiver=0x555558162708, e=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtwidgets-5.5.9999/work/qtwidgets-5.5.9999/src/widgets/kernel/qapplication.cpp:3499
#9  0x00007ffff2b8c57d in QCoreApplication::notifyInternal (this=0x7fffffffd670, receiver=0x555558162708, event=event@entry=0x7fffffffd240)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:965
#10 0x00007ffff2be60cc in sendEvent (event=0x7fffffffd240, receiver=<optimized out>) at ../../include/QtCore/../../../qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.h:224
#11 QTimerInfoList::activateTimers (this=0x55555584b370) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qtimerinfo_unix.cpp:637
#12 0x00007ffff2be66af in timerSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:177
#13 0x00007fffee2d82a9 in g_main_dispatch (context=0x7fffe0002450) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3111
#14 g_main_context_dispatch (context=context@entry=0x7fffe0002450) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3710
#15 0x00007fffee2d8538 in g_main_context_iterate (context=context@entry=0x7fffe0002450, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3781
#16 0x00007fffee2d8641 in g_main_context_iteration (context=0x7fffe0002450, may_block=1) at /var/tmp/portage/dev-libs/glib-2.42.2/work/glib-2.42.2/glib/gmain.c:3842
#17 0x00007ffff2be6ba1 in QEventDispatcherGlib::processEvents (this=0x555555852c60, flags=...)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventdispatcher_glib.cpp:418
#18 0x00007ffff2b8aa8b in QEventLoop::exec (this=this@entry=0x7fffffffd4e0, flags=..., flags@entry=...)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qeventloop.cpp:204
#19 0x00007ffff2b93018 in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:1229
#20 0x000055555558a55b in main (argc=1, argv=<optimized out>) at /var/tmp/portage/kde-plasma/plasma-workspace-9999/work/plasma-workspace-9999/shell/main.cpp:179
(gdb) c
Continuing.
got a null qscreen, oh fucking sweet
void PanelView::updateStruts()
QRect(0,0 1600x900) QRect(0,0 0x0)
screen l/r/b/t offsets are: 0 -1600 -900 0 6
setting right edge to -1560 0 899
^C
Program received signal SIGINT, Interrupt.
QCoreApplicationPrivate::sendThroughApplicationEventFilters (this=this@entry=0x555555810f70, receiver=receiver@entry=0x55555581a870, event=event@entry=0x7fffe0006240)
    at /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp:1042
1042    /var/tmp/portage/dev-qt/qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qcoreapplication.cpp: No such file or directory.

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
David Edmundson
Aleix Pol Gonzalez
Jan Kundrát
Jan Kundrát
David Edmundson
Jan Kundrát
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 0059d87b6f74f950b2aac94763c2934ec710c6c4 by Jan Kundrát to branch master.
Loading...