App: add enqueue_flushdraw() and check_flushdraw()
[staging/windowmanager.git] / src / app.hpp
index 297b6af..5ef7ab4 100644 (file)
@@ -127,8 +127,6 @@ struct App {
       return this->id_alloc.lookup(id);
    }
 
-   struct LayoutState state;
-
    // Set by AFB API when wayland events need to be dispatched
    std::atomic<bool> pending_events;
    void set_pending_events() {
@@ -140,6 +138,10 @@ struct App {
          x, false, std::memory_order_consume);
    }
 
+   std::vector<int> pending_end_draw;
+   void enqueue_flushdraw(int surface_id);
+   void check_flushdraw(int surface_id);
+
    explicit App(wl::display *d);
    ~App();
 
@@ -158,11 +160,12 @@ struct App {
    void surface_set_layout_split(uint32_t surface_id, uint32_t sub_surface_id);
 
    // Allocate a surface ID for this role
-   result<int> request_surface(char const *drawing_name);
+   result<int> api_request_surface(char const *drawing_name);
 
    // Activate (i.e. make visible, if allowed!) a surface
-   char const *activate_surface(char const *drawing_name);
-   char const *deactivate_surface(char const *drawing_name);
+   char const *api_activate_surface(char const *drawing_name);
+   char const *api_deactivate_surface(char const *drawing_name);
+   char const *api_enddraw(char const *drawing_name);
 
    // Events from the compositor we are interested in
    void surface_created(uint32_t surface_id);
@@ -180,7 +183,7 @@ struct App {
    void activate(int id);
    void deactivate(int id);
 
-   bool can_split(int new_id);
+   bool can_split(struct LayoutState const &state, int new_id);
 };
 
 }  // namespace wm