From 22cf0bf96f4a94f5fbfec6f5dfc3adeb5b66e7ac Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Thu, 29 Jun 2017 16:07:05 +0200 Subject: [PATCH] main: add wl_output proxy-to-id mapping in wl_output global handler Signed-off-by: Marcus Fritzsch --- src/main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 52d6b32..3c8bc0a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -141,14 +141,20 @@ int main(int /*argc*/, char ** /*argv*/) { struct connection c {}; + d.r.add_global_handler( + "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) { + c.outputs.emplace_back(std::make_unique(r, name, v)); + }); + d.r.add_global_handler( "ivi_controller", [&c](wl_registry *r, uint32_t name, uint32_t v) { c.c = std::make_unique(r, name, v); - }); - d.r.add_global_handler( - "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) { - c.outputs.emplace_back(std::make_unique(r, name, v)); + // XXX: This protocol needs the output, so lets just add our mapping here... + c.c->add_proxy_to_id_mapping(c.outputs.back()->proxy.get(), + wl_proxy_get_id( + reinterpret_cast( + c.outputs.back()->proxy.get()))); }); // First level objects -- 2.16.6