diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-02-18 15:10:40 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-02-18 15:13:56 +0000 |
| commit | fb8eaba83f2d114fb346730e789a559ccc366887 (patch) | |
| tree | d4fe951c24311577ccd9c950f17eb92527b4bd5a /src/protocols/XDGShell.cpp | |
| parent | 3352317ca827dfb2dfd222274dfaf5941c78c086 (diff) | |
core: add an ANR dialog
for xdg-shell, we can ping the wm_base, and thus render an ANR dialog if an app dies
for XWayland, there probably is a similar method, but I don't know about it and don't care.
Diffstat (limited to 'src/protocols/XDGShell.cpp')
| -rw-r--r-- | src/protocols/XDGShell.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/protocols/XDGShell.cpp b/src/protocols/XDGShell.cpp index f5d1a8fa..9424a9d6 100644 --- a/src/protocols/XDGShell.cpp +++ b/src/protocols/XDGShell.cpp @@ -3,6 +3,7 @@ #include <algorithm> #include "../Compositor.hpp" #include "../managers/SeatManager.hpp" +#include "../managers/ANRManager.hpp" #include "../helpers/Monitor.hpp" #include "core/Seat.hpp" #include "core/Compositor.hpp" @@ -740,6 +741,11 @@ CXDGWMBase::CXDGWMBase(SP<CXdgWmBase> resource_) : resource(resource_) { LOGM(LOG, "New xdg_surface at {:x}", (uintptr_t)RESOURCE.get()); }); + + resource->setPong([this](CXdgWmBase* r, uint32_t serial) { + g_pANRManager->onResponse(self.lock()); + events.pong.emit(); + }); } bool CXDGWMBase::good() { @@ -750,6 +756,10 @@ wl_client* CXDGWMBase::client() { return pClient; } +void CXDGWMBase::ping() { + resource->sendPing(1337); +} + CXDGShellProtocol::CXDGShellProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) { grab = makeShared<CSeatGrab>(); grab->keyboard = true; |
