summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0c010ea..1d92338 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -12,14 +12,8 @@
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");