# lv_wayland_backend_private.h (/api/drivers/wayland/lv_wayland_backend_private_h)



<ApiSummary functions="3" structs="1" typedefs="6" variables="1" />

Functions [#functions]

<ApiTabs items="[&#x22;Setters (1)&#x22;,&#x22;Getters (2)&#x22;]">
  <ApiTab value="Setters (1)">
    <ApiMember kind="function" name="lv_wayland_set_backend_display_data" file="drivers/wayland/lv_wayland_backend_private.h" line="185" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L185">
      lv_wayland_set_backend_display_data [#lv_wayland_set_backend_display_data]

      Set the backend-specific display data.

      The backend display data is set automatically to the return type of the init\_display/resize\_display, this function should only be used in special cases where it needs to be overridden temporarily

      ```c title=" " lineNumbers=1
      void lv_wayland_set_backend_display_data(lv_display_t *display, void *data)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name                | Type                                                     | Description                              |
      | ------------------- | -------------------------------------------------------- | ---------------------------------------- |
      | **\[in]** `display` | <ApiLink name="lv_display_t" display="lv_display_t *" /> | Pointer to the LVGL display object       |
      | **\[in]** `data`    | `void *`                                                 | Pointer to backend-specific display data |
    </ApiMember>
  </ApiTab>

  <ApiTab value="Getters (2)">
    <ApiMember kind="function" name="lv_wayland_get_backend_display_data" file="drivers/wayland/lv_wayland_backend_private.h" line="174" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L174">
      lv_wayland_get_backend_display_data [#lv_wayland_get_backend_display_data]

      Get the backend-specific display data.

      Retrieves the per-display data pointer that was returned by the backend's init\_display/resize\_display functions. This allows the backend to access its own display-specific state and resources.

      ```c title=" " lineNumbers=1
      void * lv_wayland_get_backend_display_data(lv_display_t *display)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name                | Type                                                     | Description                        |
      | ------------------- | -------------------------------------------------------- | ---------------------------------- |
      | **\[in]** `display` | <ApiLink name="lv_display_t" display="lv_display_t *" /> | Pointer to the LVGL display object |

      **Returns:** `void *` — Pointer to backend-specific display data

      <Callout type="info">
        This returns the value that was returned by lv\_wayland\_backend\_init\_display\_t or lv\_wayland\_backend\_resize\_display\_t
      </Callout>

      **See also:** <ApiLink name="lv_wayland_backend_init_display_t" />
    </ApiMember>

    <ApiMember kind="function" name="lv_wayland_get_window_surface" file="drivers/wayland/lv_wayland_backend_private.h" line="201" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L201">
      lv_wayland_get_window_surface [#lv_wayland_get_window_surface]

      Get the Wayland surface for rendering.

      Retrieves the wl\_surface object associated with the display window. This is the surface that the backend must use for all rendering operations (attaching buffers, committing frames, etc.).

      ```c title=" " lineNumbers=1
      struct wl_surface * lv_wayland_get_window_surface(lv_display_t *display)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name                | Type                                                     | Description                        |
      | ------------------- | -------------------------------------------------------- | ---------------------------------- |
      | **\[in]** `display` | <ApiLink name="lv_display_t" display="lv_display_t *" /> | Pointer to the LVGL display object |

      **Returns:** `struct wl_surface *` — Pointer to the Wayland surface for rendering, or NULL if not available

      <Callout type="info">
        This surface is managed by the Wayland driver and must not be destroyed by the backend
      </Callout>

      <Callout type="info">
        All rendering output should be attached to this surface
      </Callout>
    </ApiMember>
  </ApiTab>
</ApiTabs>

Structs [#structs]

<ApiMember kind="struct" name="lv_wayland_backend_ops_t">
  lv_wayland_backend_ops_t [#lv_wayland_backend_ops_t]

  Wayland backend operations structure.

  This structure defines the complete set of operations that a Wayland backend must implement. All function pointers must be non-NULL.

  | Member           | Type                                                    | Description                   |
  | ---------------- | ------------------------------------------------------- | ----------------------------- |
  | `init`           | <ApiLink name="lv_wayland_backend_init_t" />            | Initialize backend context    |
  | `global_handler` | <ApiLink name="lv_wayland_backend_global_handler_t" />  | Handle Wayland global objects |
  | `init_display`   | <ApiLink name="lv_wayland_backend_init_display_t" />    | Initialize a new display      |
  | `resize_display` | <ApiLink name="lv_wayland_backend_resize_display_t" />  | Resize or reconfigure display |
  | `deinit_display` | <ApiLink name="lv_wayland_backend_destroy_display_t" /> | Destroy a display             |
  | `deinit`         | <ApiLink name="lv_wayland_backend_deinit_t" />          | Deinitialize backend context  |

  <Callout type="info">
    **Lifecycle Order::** 1. init() - Initialize backend context
    2\. global\_handler() - Called for each Wayland global (may be called multiple times)
    3\. init\_display() - Create display (may be called multiple times for multiple displays)
    4\. resize\_display() - Resize display (called as needed)
    5\. deinit\_display() - Destroy display (called once per display)
    6\. deinit() - Clean up backend context
  </Callout>
</ApiMember>

Typedefs [#typedefs]

<ApiMember kind="typedef" name="lv_wayland_backend_init_t" file="drivers/wayland/lv_wayland_backend_private.h" line="44" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L44">
  lv_wayland_backend_init_t [#lv_wayland_backend_init_t]

  ```c title=" " lineNumbers=1
  lv_wayland_backend_init_t
  ```

  Initialize the backend context.

  This function is called once when the Wayland driver is initialized to create the global backend context. The returned pointer will be passed as backend\_ctx to all other backend operations.
</ApiMember>

<ApiMember kind="typedef" name="lv_wayland_backend_deinit_t" file="drivers/wayland/lv_wayland_backend_private.h" line="59" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L59">
  lv_wayland_backend_deinit_t [#lv_wayland_backend_deinit_t]

  ```c title=" " lineNumbers=1
  lv_wayland_backend_deinit_t
  ```

  Deinitialize the backend context.

  This function is called when the Wayland driver is deinitialized. It must clean up all resources allocated in the init function and free the backend context.
</ApiMember>

<ApiMember kind="typedef" name="lv_wayland_backend_init_display_t" file="drivers/wayland/lv_wayland_backend_private.h" line="79" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L79">
  lv_wayland_backend_init_display_t [#lv_wayland_backend_init_display_t]

  ```c title=" " lineNumbers=1
  lv_wayland_backend_init_display_t
  ```

  Initialize a new display.

  This function is called when creating a new LVGL display on Wayland. It should allocate and initialize per-display resources needed for rendering.
</ApiMember>

<ApiMember kind="typedef" name="lv_wayland_backend_resize_display_t" file="drivers/wayland/lv_wayland_backend_private.h" line="98" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L98">
  lv_wayland_backend_resize_display_t [#lv_wayland_backend_resize_display_t]

  ```c title=" " lineNumbers=1
  lv_wayland_backend_resize_display_t
  ```

  Resize or reconfigure a display.

  This function is called when a display needs to be resized or when its rotation is modified. The backend should update its rendering resources accordingly.
</ApiMember>

<ApiMember kind="typedef" name="lv_wayland_backend_destroy_display_t" file="drivers/wayland/lv_wayland_backend_private.h" line="113" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L113">
  lv_wayland_backend_destroy_display_t [#lv_wayland_backend_destroy_display_t]

  ```c title=" " lineNumbers=1
  lv_wayland_backend_destroy_display_t
  ```

  Destroy a display.

  This function is called when an LVGL display is being destroyed. It must clean up all per-display resources and free the display data that was allocated in init\_display.
</ApiMember>

<ApiMember kind="typedef" name="lv_wayland_backend_global_handler_t" file="drivers/wayland/lv_wayland_backend_private.h" line="132" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L132">
  lv_wayland_backend_global_handler_t [#lv_wayland_backend_global_handler_t]

  ```c title=" " lineNumbers=1
  lv_wayland_backend_global_handler_t
  ```

  Handle Wayland global objects.

  This function is called for every global object advertised by the Wayland compositor. The backend can use this to bind to Wayland protocols it requires (e.g., wl\_shm, EGL extensions, DMA-BUF protocols, etc.).
</ApiMember>

Variables [#variables]

<ApiMember kind="variable" name="wl_backend_ops" file="drivers/wayland/lv_wayland_backend_private.h" line="159" url="https://github.com/lvgl/lvgl/tree/a7b95c5b0839ce901c09c205610bc2c77cc3345d/src/drivers/wayland/lv_wayland_backend_private.h#L159">
  wl_backend_ops [#wl_backend_ops]

  ```c title=" " lineNumbers=1
  const lv_wayland_backend_ops_t wl_backend_ops
  ```
</ApiMember>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_wayland.h&#x22;, &#x22;wayland-client.h&#x22;]" includedBy="[&#x22;lv_wayland_private.h&#x22;]" transitiveIncludes="[&#x22;lv_anim.h&#x22;, &#x22;lv_area.h&#x22;, &#x22;lv_array.h&#x22;, &#x22;lv_assert.h&#x22;, &#x22;lv_bidi.h&#x22;, &#x22;lv_color.h&#x22;, &#x22;lv_color_op.h&#x22;, &#x22;lv_conf_internal.h&#x22;, &#x22;lv_conf_kconfig.h&#x22;, &#x22;lv_display.h&#x22;, &#x22;lv_draw.h&#x22;, &#x22;lv_draw_arc.h&#x22;, &#x22;lv_draw_blur.h&#x22;, &#x22;lv_draw_buf.h&#x22;, &#x22;lv_draw_image.h&#x22;, &#x22;lv_draw_label.h&#x22;, &#x22;lv_draw_line.h&#x22;, &#x22;lv_draw_rect.h&#x22;, &#x22;lv_draw_triangle.h&#x22;, &#x22;lv_event.h&#x22;, &#x22;lv_ext_data.h&#x22;, &#x22;lv_flex.h&#x22;, &#x22;lv_font.h&#x22;, &#x22;lv_fs.h&#x22;, &#x22;lv_grad.h&#x22;, &#x22;lv_grid.h&#x22;, &#x22;lv_group.h&#x22;, &#x22;lv_image_decoder.h&#x22;, &#x22;lv_image_dsc.h&#x22;, &#x22;lv_indev.h&#x22;, &#x22;lv_indev_gesture.h&#x22;, &#x22;lv_layout.h&#x22;, &#x22;lv_ll.h&#x22;, &#x22;lv_log.h&#x22;, &#x22;lv_math.h&#x22;, &#x22;lv_matrix.h&#x22;, &#x22;lv_mem.h&#x22;, &#x22;lv_obj.h&#x22;, &#x22;lv_obj_class.h&#x22;, &#x22;lv_obj_draw.h&#x22;, &#x22;lv_obj_event.h&#x22;, &#x22;lv_obj_pos.h&#x22;, &#x22;lv_obj_property.h&#x22;, &#x22;lv_obj_property_names.h&#x22;, &#x22;lv_obj_scroll.h&#x22;, &#x22;lv_obj_style.h&#x22;, &#x22;lv_obj_style_gen.h&#x22;, &#x22;lv_obj_tree.h&#x22;, &#x22;lv_palette.h&#x22;, &#x22;lv_profiler.h&#x22;, &#x22;lv_profiler_builtin.h&#x22;, &#x22;lv_sprintf.h&#x22;, &#x22;lv_string.h&#x22;, &#x22;lv_style.h&#x22;, &#x22;lv_style_gen.h&#x22;, &#x22;lv_style_properties.h&#x22;, &#x22;lv_symbol_def.h&#x22;, &#x22;lv_text.h&#x22;, &#x22;lv_tick.h&#x22;, &#x22;lv_timer.h&#x22;, &#x22;lv_types.h&#x22;, &#x22;lv_wayland_keyboard.h&#x22;, &#x22;lv_wayland_pointer.h&#x22;, &#x22;lv_wayland_pointer_axis.h&#x22;, &#x22;lv_wayland_touch.h&#x22;, &#x22;lv_wayland_window.h&#x22;]" />
