mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-27 02:54:36 +00:00
core/popupanchor: null check mItem in onItemWindowChanged
Also emit itemChanged in PopupAnchor::setItem().
This commit is contained in:
2 files changed
+4
-1
No files matched your search
@@ -18,3 +18,4 @@
|
||||
- Fixed `ColorQuantizer` deletion crashing if an operation was live.
|
||||
- Fixed crashes when failing to create a `ScreencopyView`.
|
||||
- Fixed `PwNodePeakMonitor` crashing when sampling a stream with mismatched channels from the node.
|
||||
- Fixed unsetting `PopupAnchor.item` causing a crash.
|
||||
@@ -93,6 +93,8 @@ void PopupAnchor::setItem(QQuickItem* item) {
|
||||
QObject::connect(item, &QObject::destroyed, this, &PopupAnchor::onItemDestroyed);
|
||||
QObject::connect(item, &QQuickItem::windowChanged, this, &PopupAnchor::onItemWindowChanged);
|
||||
}
|
||||
|
||||
emit this->itemChanged();
|
||||
}
|
||||
|
||||
void PopupAnchor::onWindowDestroyed() {
|
||||
@@ -109,7 +111,7 @@ void PopupAnchor::onItemDestroyed() {
|
||||
}
|
||||
|
||||
void PopupAnchor::onItemWindowChanged() {
|
||||
if (auto* window = qobject_cast<ProxiedWindow*>(this->mItem->window())) {
|
||||
if (auto* window = qobject_cast<ProxiedWindow*>(this->mItem ? this->mItem->window() : nullptr)) {
|
||||
this->setWindowInternal(window->proxy());
|
||||
} else {
|
||||
this->setWindowInternal(nullptr);
|
||||
|
||||
Reference in new issue
Block a user