Fix warning about nullptr sender in QObject::connect()

When one sets "no border" property, the decoration can be null.
This commit is contained in:
Vlad Zahorodnii 2024-03-20 14:49:20 +02:00
parent 236baa63df
commit 012c64b054

View file

@ -707,11 +707,13 @@ void XdgToplevelWindow::handleRolePrecommit()
{
auto configureEvent = static_cast<XdgToplevelConfigure *>(lastAcknowledgedConfigure());
if (configureEvent && decoration() != configureEvent->decoration.get()) {
connect(configureEvent->decoration.get(), &KDecoration2::Decoration::bordersChanged, this, [this]() {
if (!isDeleted()) {
scheduleConfigure();
}
});
if (configureEvent->decoration) {
connect(configureEvent->decoration.get(), &KDecoration2::Decoration::bordersChanged, this, [this]() {
if (!isDeleted()) {
scheduleConfigure();
}
});
}
setDecoration(configureEvent->decoration);
updateShadow();