Disconnect decoration button requestHover tooltip on decoration destuction
AbandonedPublic

Authored by davidedmundson on Jul 21 2018, 4:26 PM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

Decoration is destroyed at some point before DecorationButton, as seen
by the existing use of QPointer for holding the Decoration.
Use of a weak pointer without guarding seems wrong.

Every other connect (DecorationButton::Private::init) that proxies to
the decorationimplementation in kwin guards against this by setting the
connect lifespan to match decoration. This one connect was out of sync.

BUG: 396723
CCBUG: 396729

Test Plan

Ran kwin.
Checked I still had tooltips
Didn't try to reproduce the original crash

Diff Detail

Repository
R129 Window Decoration Library
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1052
Build 1065: arc lint + arc unit
davidedmundson created this revision.Jul 21 2018, 4:26 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 21 2018, 4:26 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Jul 21 2018, 4:26 PM
zzag added a subscriber: zzag.EditedJul 21 2018, 4:47 PM

Probably stupid question, but still.. Why had only one receiver been changed to decoration.data()? Why that's not the case for

connect(this, &DecorationButton::hoveredChanged, this, updateSlot);

?

Just for reference

void DecorationButton::update(const QRectF &rect)
{
    decoration()->update(rect.isNull() ? geometry().toRect() : rect.toRect());
}

Shouldn't decoration() be guarded there?

davidedmundson planned changes to this revision.Jul 21 2018, 5:37 PM

Not a stupid question. Will check

The hovered state cannot change if there is no decoration. Hover is from an event handler from Decoration. I doubt that this change here can fix the crash. Also that's the explanation for the update slot not checking: no hover change if there's no decoration.

The crash is weird: we did have a crash related to tooltips, but it's fixed.

What's really strange is that requestShowTooltip comes from the event loop. But nothing in kdecoration or in KWin goes through a queued event to KWin::Decoration::DecoratedClientImpl::requestShowToolTip.

Could it be a decoration plugin causing this?

davidedmundson abandoned this revision.Sep 13 2018, 9:37 AM