summaryrefslogtreecommitdiff
path: root/src/protocols/XDGBell.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2025-04-30 00:10:07 +0100
committerVaxry <vaxry@vaxry.net>2025-04-30 00:10:07 +0100
commit450687131047a666ca5540f47e0d0b80d29db774 (patch)
tree2747ca2957e39aba6786907440faff92986d6432 /src/protocols/XDGBell.cpp
parent6483f4ec220a301ea3eb9a61124bc5fcb8259ed2 (diff)
xdg-bell: avoid crashes on null toplevel
Diffstat (limited to 'src/protocols/XDGBell.cpp')
-rw-r--r--src/protocols/XDGBell.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/protocols/XDGBell.cpp b/src/protocols/XDGBell.cpp
index 61f070ff..593d78fc 100644
--- a/src/protocols/XDGBell.cpp
+++ b/src/protocols/XDGBell.cpp
@@ -12,6 +12,14 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1
m_resource->setOnDestroy([this](CXdgSystemBellV1* r) { PROTO::xdgBell->destroyResource(this); });
m_resource->setRing([](CXdgSystemBellV1* r, wl_resource* toplevel) {
+ if (!toplevel) {
+ g_pEventManager->postEvent(SHyprIPCEvent{
+ .event = "bell",
+ .data = "",
+ });
+ return;
+ }
+
auto TOPLEVEL = CXDGToplevelResource::fromResource(toplevel);
if (!TOPLEVEL) {