return -1;
}
+#define CHECK_WAYLAND() \
+ do { \
+ if (g_wayland == nullptr) { \
+ afb_req_fail(req, "failed", \
+ "Binding not initialized, did the compositor die?"); \
+ return; \
+ } \
+ } while (0)
+
// _ _ _ _ ____
// __| | ___| |__ _ _ __ _ ___| |_ __ _| |_ _ _ ___ / /\ \
// / _` |/ _ \ '_ \| | | |/ _` | / __| __/ _` | __| | | / __| | | |
// Quick and dirty, dump current surfaces and layers
AFB_REQ_DEBUG(req, "status");
- if (g_wayland == nullptr) {
- afb_req_fail(req, "failed",
- "Binding not initialized, did the compositor die?");
- return;
- }
+ CHECK_WAYLAND();
try {
json j;
}
void debug_surfaces(afb_req req) {
+ CHECK_WAYLAND();
+
auto a = json_object_new_array();
if (!g_wayland->controller->surfaces.empty()) {
}
void debug_layers(afb_req req) {
+ CHECK_WAYLAND();
+
auto a = json_object_new_array();
if (!g_wayland->controller->layers.empty()) {