X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain.cpp;h=5e74ed8e8da9043e0ae7174bc3e80906f80e8c0d;hb=910704d00adeea1b6516e3fd444e5273b8ebbbbb;hp=0c010ea465991217ab21e1df8701058f5a86cbfc;hpb=db95653246560c24ad3c8cb224b3d9321b50af0a;p=staging%2Fwindowmanager.git diff --git a/src/main.cpp b/src/main.cpp index 0c010ea..5e74ed8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,14 +12,8 @@ struct conn { std::vector> outputs; std::unique_ptr c; - - ~conn(); }; -conn::~conn() { - this->outputs.clear(); -} - int main(int argc, char **argv) { lognotice("WinMan ver. %s", WINMAN_VERSION_STRING); @@ -27,29 +21,36 @@ int main(int argc, char **argv) { fatal("Environment variable XDG_RUNTIME_DIR not set"); auto d = std::make_unique(); - if (!d->d) + if (!d->ok()) fatal("Could not connect to compositor"); struct conn c = {}; - d->r->add_global_handler("ivi_controller", [&](wl_registry *r, uint32_t name, uint32_t v) { - c.c = std::make_unique(r, name, v); - }); + d->r->add_global_handler( + "ivi_controller", [&](wl_registry *r, uint32_t name, uint32_t v) { + c.c = std::make_unique(r, name, v); + }); - d->r->add_global_handler("wl_output", [&](wl_registry *r, uint32_t name, uint32_t v) { - c.outputs.emplace_back(std::make_unique(r, name, v)); - }); + d->r->add_global_handler( + "wl_output", [&](wl_registry *r, uint32_t name, uint32_t v) { + c.outputs.emplace_back(std::make_unique(r, name, v)); + }); // First level objects d->roundtrip(); // Second level objects d->roundtrip(); // Third level objects - /* wl_display_roundtrip(c.d); */ + d->roundtrip(); if (!c.c) fatal("ivi_controller global not available"); - // main loop + + /* while (1) { */ + /* int ret = d->dispatch(); */ + /* if (ret != 0) */ + /* break; */ + /* } */ return 0; }