wayland: remove surfaces that got destroyed
[staging/windowmanager.git] / src / wayland.cpp
index b4f4800..38092e3 100644 (file)
@@ -32,6 +32,10 @@ void display::roundtrip() { wl_display_roundtrip(this->d.get()); }
 
 int display::dispatch() { return wl_display_dispatch(this->d.get()); }
 
+void display::flush() { wl_display_flush(this->d.get()); }
+
+int display::get_fd() const { return wl_display_get_fd(this->d.get()); }
+
 //                 _     _
 //  _ __ ___  __ _(_)___| |_ _ __ _   _
 // | '__/ _ \/ _` | / __| __| '__| | | |
@@ -503,6 +507,10 @@ void controller::surface_destroyed(uint32_t id) {
 void controller::surface_content(uint32_t id, int32_t content_state) {
    logdebug("genivi::surface %s @ %p s %i", __func__, this->proxy,
             content_state);
+
+   if (content_state == IVI_CONTROLLER_SURFACE_CONTENT_STATE_CONTENT_REMOVED) {
+      this->surfaces.erase(id);
+   }
 }
 
 //