hooked up genivi::surface and layer
[staging/windowmanager.git] / src / main.cpp
index 0c010ea..1d92338 100644 (file)
 struct conn {
    std::vector<std::unique_ptr<wl::output>> outputs;
    std::unique_ptr<genivi::controller> c;
-
-   ~conn();
 };
 
-conn::~conn() {
-   this->outputs.clear();
-}
-
 int main(int argc, char **argv) {
    lognotice("WinMan ver. %s", WINMAN_VERSION_STRING);
 
@@ -27,25 +21,27 @@ int main(int argc, char **argv) {
       fatal("Environment variable XDG_RUNTIME_DIR not set");
 
    auto d = std::make_unique<wl::display>();
-   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<genivi::controller>(r, name, v);
-   });
+   d->r->add_global_handler(
+      "ivi_controller", [&](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", [&](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(
+      "wl_output", [&](wl_registry *r, uint32_t name, uint32_t v) {
+         c.outputs.emplace_back(std::make_unique<wl::output>(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");