mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-18 13:33:50 -07:00
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.
This commit is contained in:
@@ -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;
|
||||
|
@@ -241,12 +241,17 @@ class CXDGWMBase {
|
||||
|
||||
bool good();
|
||||
wl_client* client();
|
||||
void ping();
|
||||
|
||||
std::vector<WP<CXDGPositionerResource>> positioners;
|
||||
std::vector<WP<CXDGSurfaceResource>> surfaces;
|
||||
|
||||
WP<CXDGWMBase> self;
|
||||
|
||||
struct {
|
||||
CSignal pong;
|
||||
} events;
|
||||
|
||||
private:
|
||||
SP<CXdgWmBase> resource;
|
||||
wl_client* pClient = nullptr;
|
||||
|
Reference in New Issue
Block a user