From 6b648180458e9625e1f700962537c3d4e501f6cc Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Tue, 12 Sep 2017 11:29:27 +0200 Subject: [PATCH] binding: add ping() API call Signed-off-by: Marcus Fritzsch --- generate-binding-glue.py | 6 +++++- src/afb_binding_api.cpp | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/generate-binding-glue.py b/generate-binding-glue.py index 7e003a5..db0b546 100644 --- a/generate-binding-glue.py +++ b/generate-binding-glue.py @@ -49,7 +49,10 @@ def emit_func_impl(api, f): def emit_func(api, f): p('void %(impl_name)s(afb_req req) noexcept {' % f) - p(' std::lock_guard guard(binding_m);') + #p(' std::lock_guard guard(binding_m);') + p(' #ifdef ST') + p(' ST();') + p(' #endif') p(' if (g_afb_instance == nullptr) {', ' afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?");', ' return;', @@ -127,6 +130,7 @@ API = { ], }, { 'name': 'list_drawing_names', }, + { 'name': 'ping' }, { 'name': 'debug_status', }, { 'name': 'debug_layers', }, diff --git a/src/afb_binding_api.cpp b/src/afb_binding_api.cpp index d0df3b6..7e6aa89 100644 --- a/src/afb_binding_api.cpp +++ b/src/afb_binding_api.cpp @@ -99,4 +99,9 @@ binding_api::result_type binding_api::debug_terminate() { return Ok(json_object_new_object()); } +binding_api::result_type binding_api::ping() { + this->app->dispatch_events(); + return Ok(json_object_new_object()); +} + } // namespace wm -- 2.16.6