mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-16 04:23:49 -07:00
xdg-bell: avoid crashes on null toplevel
This commit is contained in:
@@ -12,6 +12,14 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1
|
|||||||
m_resource->setOnDestroy([this](CXdgSystemBellV1* r) { PROTO::xdgBell->destroyResource(this); });
|
m_resource->setOnDestroy([this](CXdgSystemBellV1* r) { PROTO::xdgBell->destroyResource(this); });
|
||||||
|
|
||||||
m_resource->setRing([](CXdgSystemBellV1* r, wl_resource* toplevel) {
|
m_resource->setRing([](CXdgSystemBellV1* r, wl_resource* toplevel) {
|
||||||
|
if (!toplevel) {
|
||||||
|
g_pEventManager->postEvent(SHyprIPCEvent{
|
||||||
|
.event = "bell",
|
||||||
|
.data = "",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto TOPLEVEL = CXDGToplevelResource::fromResource(toplevel);
|
auto TOPLEVEL = CXDGToplevelResource::fromResource(toplevel);
|
||||||
|
|
||||||
if (!TOPLEVEL) {
|
if (!TOPLEVEL) {
|
||||||
|
Reference in New Issue
Block a user