diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-04-30 14:07:23 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-04-30 14:07:23 +0100 |
| commit | 5d005f11fa218d26ed2cf6ce75cd9aac9c2c00e5 (patch) | |
| tree | a56a117d397898d28c26576b62225074cdfcc5a7 /src | |
| parent | 54c89104de0fca8d2e1df411bfb53d5c09a5fc5e (diff) | |
xdg-bell: fix wrong resource cast
Diffstat (limited to 'src')
| -rw-r--r-- | src/protocols/XDGBell.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/protocols/XDGBell.cpp b/src/protocols/XDGBell.cpp index 593d78fc..f2cedf66 100644 --- a/src/protocols/XDGBell.cpp +++ b/src/protocols/XDGBell.cpp @@ -1,5 +1,5 @@ #include "XDGBell.hpp" -#include "XDGShell.hpp" +#include "core/Compositor.hpp" #include "../desktop/Window.hpp" #include "../managers/EventManager.hpp" #include "../Compositor.hpp" @@ -11,8 +11,8 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1 m_resource->setDestroy([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) { - if (!toplevel) { + m_resource->setRing([](CXdgSystemBellV1* r, wl_resource* surface) { + if (!surface) { g_pEventManager->postEvent(SHyprIPCEvent{ .event = "bell", .data = "", @@ -20,9 +20,9 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1 return; } - auto TOPLEVEL = CXDGToplevelResource::fromResource(toplevel); + const auto SURFACE = CWLSurfaceResource::fromResource(surface); - if (!TOPLEVEL) { + if (!SURFACE) { g_pEventManager->postEvent(SHyprIPCEvent{ .event = "bell", .data = "", @@ -31,10 +31,10 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1 } for (const auto& w : g_pCompositor->m_windows) { - if (!w->m_isMapped || w->m_isX11 || !w->m_xdgSurface) + if (!w->m_isMapped || w->m_isX11 || !w->m_xdgSurface || !w->m_wlSurface) continue; - if (w->m_xdgSurface == TOPLEVEL->owner) { + if (w->m_wlSurface->resource() == SURFACE) { g_pEventManager->postEvent(SHyprIPCEvent{ .event = "bell", .data = std::format("{:x}", (uintptr_t)w.get()), |
