Wayland Interaction

Wayland Interaction — Wayland backend-specific functions

Includes

#include <cdk/cdkwayland.h>

Description

The functions in this section are specific to the CDK Wayland backend. To use them, you need to include the <cdk/cdkwayland.h> header and use the Wayland-specific pkg-config files to build your application (either cdk-wayland-3.0 or ctk+-wayland-3.0).

To make your code compile with other CDK backends, guard backend-specific calls by an ifdef as follows. Since CDK may be built with multiple backends, you should also check for the backend that is in use (e.g. by using the CDK_IS_WAYLAND_DISPLAY() macro).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifdef CDK_WINDOWING_WAYLAND
  if (CDK_IS_WAYLAND_DISPLAY (display))
    {
      // make Wayland-specific calls here
    }
  else
#endif
#ifdef CDK_WINDOWING_X11
  if (CDK_IS_X11_DISPLAY (display))
    {
      // make X11-specific calls here
    }
  else
#endif
  g_error ("Unsupported CDK backend");

Functions