From a9215145dd85f9245accda557f3b92e34d016107 Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Wed, 2 Aug 2017 14:13:08 +0200 Subject: [PATCH] wayland: add {surface,layer}_exists(uint32_t) methods Signed-off-by: Marcus Fritzsch --- src/wayland.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wayland.hpp b/src/wayland.hpp index b0b3674..4191ea0 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -298,6 +298,15 @@ struct controller : public wayland_proxy { std::function &&f); void execute_pending(); + + bool surface_exists(uint32_t id) const { + return this->surfaces.find(id) != this->surfaces.end(); + } + + bool layer_exists(uint32_t id) const { + return this->layers.find(id) != this->layers.end(); + } + controller(struct wl_registry *r, uint32_t name, uint32_t version); // Requests -- 2.16.6