Bismuth-Forge / bismuth

KDE Plasma add-on, that tiles your windows automatically and lets you manage them via keyboard, similarly to i3, Sway or dwm.
https://bismuth-forge.github.io/bismuth/
Other
2.41k stars 93 forks source link

[Bug]: crash in kconfigwatcher usage #379

Closed davidedmundson closed 2 years ago

davidedmundson commented 2 years ago

Summary

We had a downstream report: https://bugs.kde.org/show_bug.cgi?id=455810

Crash is caused by

connect(m_kdeglobalsWatcher.data(), &KConfigWatcher::configChanged, [this](const KConfigGroup &group, const QByteArrayList &names) {

we want

connect(m_kdeglobalsWatcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group, const QByteArrayList &names) {

the sharedptr can outlive this class, therefore it needs scoping.

Steps to Reproduce

see above

Expected behavior

see above

Screenshots

No response

Bismuth version

any

KDE Plasma version

5.25.

The platform KWin is running on

X11

Additional context

No response

davidedmundson commented 2 years ago

In future would you consider adding some "namespace Bismuth" everywhere. It'll save me some time upstream if we can spot 3rd parties earlier

gikari commented 2 years ago

In future would you consider adding some "namespace Bismuth" everywhere. It'll save me some time upstream if we can spot 3rd parties earlier

Yeah, sure. But the decoration code was already in a Bismuth namespace, wasn't it?

davidedmundson commented 2 years ago

In future would you consider adding some "namespace Bismuth" everywhere. It'll save me some time upstream if we can spot 3rd parties earlier

Yeah, sure. But the decoration code was already in a Bismuth namespace, wasn't it?

Ah maybe. Bismuth wasn't in the backtrace we had, but maybe the lambda got inlined.

davidedmundson commented 2 years ago

Thanks

xpufx commented 2 years ago

@gikari I have a similar issue but it does not need Bismuth enabled, just the Window Decoration bismuth has to be enabled. Would this fix that or is it a separate issue?

gikari commented 2 years ago

@gikari I have a similar issue but it does not need Bismuth enabled, just the Window Decoration bismuth has to be enabled. Would this fix that or is it a separate issue?

Yes.

xpufx commented 2 years ago

@gikari I have a similar issue but it does not need Bismuth enabled, just the Window Decoration bismuth has to be enabled. Would this fix that or is it a separate issue?

Yes.

I applied the changes. Seems to fix it. Thanks.