mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-05-19 08:30:22 -07:00
xdg-bell: fix wrong resource cast
This commit is contained in:
parent
54c89104de
commit
5d005f11fa
@ -1,5 +1,5 @@
|
|||||||
#include "XDGBell.hpp"
|
#include "XDGBell.hpp"
|
||||||
#include "XDGShell.hpp"
|
#include "core/Compositor.hpp"
|
||||||
#include "../desktop/Window.hpp"
|
#include "../desktop/Window.hpp"
|
||||||
#include "../managers/EventManager.hpp"
|
#include "../managers/EventManager.hpp"
|
||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
@ -11,8 +11,8 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1
|
|||||||
m_resource->setDestroy([this](CXdgSystemBellV1* r) { PROTO::xdgBell->destroyResource(this); });
|
m_resource->setDestroy([this](CXdgSystemBellV1* r) { PROTO::xdgBell->destroyResource(this); });
|
||||||
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* surface) {
|
||||||
if (!toplevel) {
|
if (!surface) {
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{
|
g_pEventManager->postEvent(SHyprIPCEvent{
|
||||||
.event = "bell",
|
.event = "bell",
|
||||||
.data = "",
|
.data = "",
|
||||||
@ -20,9 +20,9 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto TOPLEVEL = CXDGToplevelResource::fromResource(toplevel);
|
const auto SURFACE = CWLSurfaceResource::fromResource(surface);
|
||||||
|
|
||||||
if (!TOPLEVEL) {
|
if (!SURFACE) {
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{
|
g_pEventManager->postEvent(SHyprIPCEvent{
|
||||||
.event = "bell",
|
.event = "bell",
|
||||||
.data = "",
|
.data = "",
|
||||||
@ -31,10 +31,10 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (const auto& w : g_pCompositor->m_windows) {
|
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;
|
continue;
|
||||||
|
|
||||||
if (w->m_xdgSurface == TOPLEVEL->owner) {
|
if (w->m_wlSurface->resource() == SURFACE) {
|
||||||
g_pEventManager->postEvent(SHyprIPCEvent{
|
g_pEventManager->postEvent(SHyprIPCEvent{
|
||||||
.event = "bell",
|
.event = "bell",
|
||||||
.data = std::format("{:x}", (uintptr_t)w.get()),
|
.data = std::format("{:x}", (uintptr_t)w.get()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user