hyprland/focus_grab: handle destruction of tracked windows

This commit is contained in:
outfoxxed 2026-03-18 02:34:06 -07:00
parent 3520c85d77
commit 0cb62920a7
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
11 changed files with 67 additions and 102 deletions

View file

@ -18,7 +18,6 @@
#include <qwindow.h>
#include "../window/proxywindow.hpp"
#include "../window/windowinterface.hpp"
#include "iconprovider.hpp"
#include "model.hpp"
#include "platformmenu_p.hpp"
@ -91,10 +90,8 @@ bool PlatformMenuEntry::display(QObject* parentWindow, int relativeX, int relati
} else if (parentWindow == nullptr) {
qCritical() << "Cannot display PlatformMenuEntry with null parent window.";
return false;
} else if (auto* proxy = qobject_cast<ProxyWindowBase*>(parentWindow)) {
} else if (auto* proxy = ProxyWindowBase::forObject(parentWindow)) {
window = proxy->backingWindow();
} else if (auto* interface = qobject_cast<WindowInterface*>(parentWindow)) {
window = interface->proxyWindow()->backingWindow();
} else {
qCritical() << "PlatformMenuEntry.display() must be called with a window.";
return false;

View file

@ -11,7 +11,6 @@
#include <qwindow.h>
#include "../window/proxywindow.hpp"
#include "../window/windowinterface.hpp"
#include "types.hpp"
bool PopupAnchorState::operator==(const PopupAnchorState& other) const {
@ -40,10 +39,8 @@ void PopupAnchor::setWindowInternal(QObject* window) {
}
if (window) {
if (auto* proxy = qobject_cast<ProxyWindowBase*>(window)) {
if (auto* proxy = ProxyWindowBase::forObject(window)) {
this->bProxyWindow = proxy;
} else if (auto* interface = qobject_cast<WindowInterface*>(window)) {
this->bProxyWindow = interface->proxyWindow();
} else {
qWarning() << "Tried to set popup anchor window to" << window
<< "which is not a quickshell window.";