aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.cpp14
1 files 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
@@ -142,13 +142,19 @@ 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<wl::output>(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<genivi::controller>(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<wl::output>(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<struct wl_proxy *>(
+ c.outputs.back()->proxy.get())));
});
// First level objects