all: clang-format
[staging/windowmanager.git] / src / main.cpp
index 85169de..571ffca 100644 (file)
@@ -86,19 +86,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<wl::output>(r, name, v));
-           });
+      "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);
 
-         // 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())));
+         // 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
@@ -112,18 +113,16 @@ int main(int /*argc*/, char ** /*argv*/) {
       fatal("Could not init layout: %s", e);
    }
 
-   struct Poller p{};
+   struct Poller p {};
    p.add_fd(STDIN_FILENO, [&c](int fd) {
-       int buf;
-       ssize_t ret;
-       ret = read(fd, &buf, sizeof(buf));
-       c.c->debug_dump_current_status();
-       return ret == 0 ? -1 : 0;
+      int buf;
+      ssize_t ret;
+      ret = read(fd, &buf, sizeof(buf));
+      c.c->debug_dump_current_status();
+      return ret == 0 ? -1 : 0;
    });
 
-   p.add_fd(d.get_fd(), [&d](int fd) {
-      return d.dispatch();
-   });
+   p.add_fd(d.get_fd(), [&d](int fd) { return d.dispatch(); });
 
    sigset_t sset{};
    sigemptyset(&sset);
@@ -135,7 +134,7 @@ int main(int /*argc*/, char ** /*argv*/) {
    p.add_fd(sfd.fd, [](int fd) {
       struct signalfd_siginfo si;
       while (read(fd, &si, sizeof(si)) == sizeof(si)) {
-          lognotice("Received signal %u", si.ssi_signo);
+         lognotice("Received signal %u", si.ssi_signo);
       }
       return -1;
    });