Clutter Reference Manual: Wayland specific support

## Wayland specific support Wayland specific support — Wayland specific API |

## Functions

struct wl_seat * | clutter_wayland_input_device_get_wl_seat ()
struct wl_shell_surface * | clutter_wayland_stage_get_wl_shell_surface ()
struct wl_surface * | clutter_wayland_stage_get_wl_surface ()
void | clutter_wayland_stage_set_wl_surface ()
void | clutter_wayland_set_display ()
void | clutter_wayland_disable_event_retrieval ()

## Description

The Wayland backend for Clutter provides some specific API, allowing integration with the Wayland client API for acessing the underlying data structures

The Clutter Wayland API is available since Clutter 1.10

## Functions

### clutter_wayland_input_device_get_wl_seat ()

    struct wl_seat *
    clutter_wayland_input_device_get_wl_seat
                                   (ClutterInputDevice *device);

Access the underlying data structure representing the Wayland device that is backing this ClutterInputDevice.

Note: this function can only be called when running on the Wayland platform. Calling this function at any other time will return `NULL`.

#### Parameters

device | a ClutterInputDevice |

#### Returns

the Wayland input device associated with the `device` .

[transfer none]

Since 1.10

### clutter_wayland_stage_get_wl_shell_surface ()

    struct wl_shell_surface *
    clutter_wayland_stage_get_wl_shell_surface
                                   (ClutterStage *stage);

Access the underlying data structure representing the shell surface that is backing the ClutterStage

Note: this function can only be called when running on the Wayland platform. Calling this function at any other time will return `NULL`.

#### Parameters

stage | a ClutterStage |

#### Returns

the Wayland shell surface associated with `stage` .

[transfer none]

Since 1.10

### clutter_wayland_stage_get_wl_surface ()

    struct wl_surface *
    clutter_wayland_stage_get_wl_surface (ClutterStage *stage);

Access the underlying data structure representing the surface that is backing the ClutterStage

Note: this function can only be called when running on the Wayland platform. Calling this function at any other time will return `NULL`.

#### Parameters

stage | a ClutterStage |

#### Returns

the Wayland surface associated with `stage` .

[transfer none]

Since 1.10

### clutter_wayland_stage_set_wl_surface ()

    void
    clutter_wayland_stage_set_wl_surface (ClutterStage *stage,
                                          struct wl_surface *surface);

Allows you to explicitly provide an existing Wayland surface to associate with `stage` , preventing Cogl from allocating a surface and shell surface for the stage automatically.

This function must be called before `stage` is shown.

Note: this function can only be called when running on the Wayland platform. Calling this function at any other time has no effect.

#### Parameters

stage | a ClutterStage |
surface | A Wayland surface to associate with the `stage` . |

Since 1.16

### clutter_wayland_set_display ()

    void
    clutter_wayland_set_display (struct wl_display *display);

Sets the display connection Clutter should use; must be called before `clutter_init()`, `clutter_init_with_args()` or other functions pertaining Clutter's initialization process.

If you are parsing the command line arguments by retrieving Clutter's GOptionGroup with `clutter_get_option_group()` and calling `g_option_context_parse()` yourself, you should also call `clutter_wayland_set_display()` before `g_option_context_parse()`.

#### Parameters

display | pointer to a wayland display |

Since 1.16

### clutter_wayland_disable_event_retrieval ()

    void
    clutter_wayland_disable_event_retrieval
                                   (void);

Disables the dispatch of the events in the main loop.

This is useful for integrating Clutter with another library that will do the event dispatch; in general only a single source should be acting on changes on the Wayland file descriptor.

This function can only be called before calling `clutter_init()`.

This function should not be normally used by applications.

Since 1.16

## Types and Values