xdg-bell: avoid crashes on null toplevel
This commit is contained in:
parent
6483f4ec22
commit
4506871310
1 changed files with 8 additions and 0 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue