Bug 382233

Summary: FrameSvgItem::setEnabledBorders causes fixedMargins to signal an update
Product: [Frameworks and Libraries] libplasma Reporter: David Edmundson <kde>
Component: componentsAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal CC: simonandric5
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description David Edmundson 2017-07-11 11:01:28 UTC
setEnabledBorders causes fixedMargins to signal an update. This is wrong as they're fixed.
(They give the same values, but still gives us that binding loop on startup in Desktop.qml)

#10 0x00007ffff79a2efd in Plasma::FrameSvgItem::doUpdate (this=0xaac010)
    at /home/david/projects/kde5/src/frameworks/plasma-framework/src/declarativeimports/core/framesvgitem.cpp:453
453         m_fixedMargins->update();
(gdb) 
#11 0x00007ffff79a5ce1 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (Plasma::FrameSvgItem::*)()>::call(void (Plasma::FrameSvgItem::*)(), Plasma::FrameSvgItem*, void**) (f=(void (Plasma::FrameSvgItem::*)(Plasma::FrameSvgItem * const)) 0x7ffff79a2b30 <Plasma::FrameSvgItem::doUpdate()>, o=0xaac010, 
    arg=0x7fffffffa3d8) at /opt/qt5/include/QtCore/qobjectdefs_impl.h:136
136                 (o->*f)((*reinterpret_cast<typename RemoveRef<SignalArgs>::Type *>(arg[II+1]))...), ApplyReturnValue<R>(arg[0]);
(gdb) 
#12 0x00007ffff79a5b11 in QtPrivate::FunctionPointer<void (Plasma::FrameSvgItem::*)()>::call<QtPrivate::List<>, void>(void (Plasma::FrameSvgItem::*)(), Plasma::FrameSvgItem*, void**) (f=(void (Plasma::FrameSvgItem::*)(Plasma::FrameSvgItem * const)) 0x7ffff79a2b30 <Plasma::FrameSvgItem::doUpdate()>, o=0xaac010, arg=0x7fffffffa3d8)
    at /opt/qt5/include/QtCore/qobjectdefs_impl.h:169
169                 FunctorCall<typename Indexes<ArgumentCount>::Value, SignalArgs, R, Function>::call(f, o, arg);
(gdb) 
#13 0x00007ffff79a5897 in QtPrivate::QSlotObject<void (Plasma::FrameSvgItem::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0xaebad0, r=0xaac010, a=0x7fffffffa3d8, ret=0x0) at /opt/qt5/include/QtCore/qobject_impl.h:120
120                     FuncType::template call<Args, R>(static_cast<QSlotObject*>(this_)->function, static_cast<typename FuncType::Object *>(r), a);
(gdb) 
#14 0x00007ffff15818e9 in QtPrivate::QSlotObjectBase::call (a=<optimized out>, r=0xaac010, this=0xaebad0)
    at ../../include/QtCore/../../../../qt5/qtbase/src/corelib/kernel/qobject_impl.h:101
101             inline void call(QObject *r, void **a)  { m_impl(Call,    this, r, a, Q_NULLPTR); }
(gdb) 
#15 QMetaObject::activate (sender=sender@entry=0xaabdc0, signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0)
    at /run/media/david/15cbf614-32ad-44e8-9fdc-466f76304ed7/projects/qt5/qtbase/src/corelib/kernel/qobject.cpp:3749
3749                    obj->call(receiver, argv ? argv : empty_argv);
(gdb) 
#16 0x00007ffff1581d7b in QMetaObject::activate (sender=0xaabdc0, m=<optimized out>, local_signal_index=0, argv=0x0)
    at /run/media/david/15cbf614-32ad-44e8-9fdc-466f76304ed7/projects/qt5/qtbase/src/corelib/kernel/qobject.cpp:3628
3628        activate(sender, QMetaObjectPrivate::signalOffset(m), local_signal_index, argv);
(gdb) 
#17 0x00007ffff5b04e9f in Plasma::Svg::repaintNeeded (this=0xaabdc0) at src/plasma/moc_svg.cpp:393
393         QMetaObject::activate(this, &staticMetaObject, 0, nullptr);
(gdb) 
#18 0x00007ffff5af8d36 in Plasma::FrameSvgPrivate::updateAndSignalSizes (this=0xaa3450)
    at /home/david/projects/kde5/src/frameworks/plasma-framework/src/plasma/framesvg.cpp:953
953         emit q->repaintNeeded();
(gdb) 
#19 0x00007ffff5af6449 in Plasma::FrameSvgPrivate::updateFrameData (this=0xaa3450, updateType=Plasma::FrameSvgPrivate::UpdateFrameAndMargins)
    at /home/david/projects/kde5/src/frameworks/plasma-framework/src/plasma/framesvg.cpp:735
735             updateAndSignalSizes();
(gdb) 
#20 0x00007ffff5af2a10 in Plasma::FrameSvg::setEnabledBorders (this=0xaabdc0, borders=...)
    at /home/david/projects/kde5/src/frameworks/plasma-framework/src/plasma/framesvg.cpp:96
96              d->updateFrameData();
(gdb) 
#21 0x00007ffff79a2a2b in Plasma::FrameSvgItem::setEnabledBorders (this=0xaac010, borders=...)
    at /home/david/projects/kde5/src/frameworks/plasma-framework/src/declarativeimports/core/framesvgitem.cpp:404
404         m_frameSvg->setEnabledBorders(borders);
(gdb) 
#22 0x00007ffff797a428 in PlasmaQuick::DialogPrivate::syncBorders (this=0xb14c10, geom=...)
    at /home/david/projects/kde5/src/frameworks/plasma-framework/src/plasmaquick/dialog.cpp:228
228             frameSvgItem->setEnabledBorders((Plasma::FrameSvg::EnabledBorder)borders);
(gdb) 


This is since the big refactoring.
Comment 1 Aleix Pol 2017-11-16 15:20:51 UTC
Git commit 11c9206bf68f6e8f00d9bc41601f492d38d67f4d by Aleix Pol.
Committed on 16/11/2017 at 15:18.
Pushed by apol into branch 'master'.

Reduce spurious signal emissions

Summary:
We were reporting that the margins were changing whenever anything changed
in a FrameSvg, this patch makes sure we are only reporting the changes
when it actually changes.
This also fixes a binding loop in Desktop.qml from plasma-desktop.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: broulik, davidedmundson, plasma-devel, #frameworks

Tags: #plasma, #frameworks

Differential Revision: https://phabricator.kde.org/D8809

M  +39   -21   src/declarativeimports/core/framesvgitem.cpp
M  +3    -0    src/declarativeimports/core/framesvgitem.h
M  +2    -2    src/plasma/framesvg.cpp

https://commits.kde.org/plasma-framework/11c9206bf68f6e8f00d9bc41601f492d38d67f4d