Data Structures | Macros | Enumerations | Functions
The xdg_shell interface

xdg_shell allows clients to turn a wl_surface into a "real window" which can be dragged, resized, stacked, and moved around by the user. More...

Data Structures

struct  xdg_shell_listener
 xdg_shell - create desktop-style surfaces : check if the client is alive More...
 

Macros

#define XDG_SHELL_PING_SINCE_VERSION   1
 
#define XDG_SHELL_DESTROY_SINCE_VERSION   1
 
#define XDG_SHELL_USE_UNSTABLE_VERSION_SINCE_VERSION   1
 
#define XDG_SHELL_GET_XDG_SURFACE_SINCE_VERSION   1
 
#define XDG_SHELL_GET_XDG_POPUP_SINCE_VERSION   1
 
#define XDG_SHELL_PONG_SINCE_VERSION   1
 

Enumerations

enum  xdg_shell_version {
  XDG_SHELL_VERSION_CURRENT = 5,
  XDG_SHELL_VERSION_CURRENT = 5
}
 latest protocol version More...
 

Functions

static int xdg_shell_add_listener (struct xdg_shell *xdg_shell, const struct xdg_shell_listener *listener, void *data)
 
static void xdg_shell_set_user_data (struct xdg_shell *xdg_shell, void *user_data)
 
static void * xdg_shell_get_user_data (struct xdg_shell *xdg_shell)
 
static void xdg_shell_destroy (struct xdg_shell *xdg_shell)
 Destroy this xdg_shell object. More...
 
static void xdg_shell_use_unstable_version (struct xdg_shell *xdg_shell, int32_t version)
 Negotiate the unstable version of the interface. More...
 
static struct xdg_surface * xdg_shell_get_xdg_surface (struct xdg_shell *xdg_shell, struct wl_surface *surface)
 This creates an xdg_surface for the given surface and gives it the xdg_surface role. More...
 
static struct xdg_popup * xdg_shell_get_xdg_popup (struct xdg_shell *xdg_shell, struct wl_surface *surface, struct wl_surface *parent, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
 This creates an xdg_popup for the given surface and gives it the xdg_popup role. More...
 
static void xdg_shell_pong (struct xdg_shell *xdg_shell, uint32_t serial)
 A client must respond to a ping event with a pong request or the client may be deemed unresponsive.
 

Detailed Description

xdg_shell allows clients to turn a wl_surface into a "real window" which can be dragged, resized, stacked, and moved around by the user.

Everything about this interface is suited towards traditional desktop environments.

Enumeration Type Documentation

◆ xdg_shell_version

enum xdg_shell_version

latest protocol version

The 'current' member of this enum gives the version of the protocol. Implementations can compare this to the version they implement using static_assert to ensure the protocol and implementation versions match.

Enumerator
XDG_SHELL_VERSION_CURRENT 

Always the latest version.

Function Documentation

◆ xdg_shell_destroy()

static void xdg_shell_destroy ( struct xdg_shell *  xdg_shell)
inlinestatic

Destroy this xdg_shell object.

Destroying a bound xdg_shell object while there are surfaces still alive created by this xdg_shell object instance is illegal and will result in a protocol error.

◆ xdg_shell_use_unstable_version()

static void xdg_shell_use_unstable_version ( struct xdg_shell *  xdg_shell,
int32_t  version 
)
inlinestatic

Negotiate the unstable version of the interface.

This mechanism is in place to ensure client and server agree on the unstable versions of the protocol that they speak or exit cleanly if they don't agree. This request will go away once the xdg-shell protocol is stable.

◆ xdg_shell_get_xdg_surface()

static struct xdg_surface* xdg_shell_get_xdg_surface ( struct xdg_shell *  xdg_shell,
struct wl_surface *  surface 
)
inlinestatic

This creates an xdg_surface for the given surface and gives it the xdg_surface role.

A wl_surface can only be given an xdg_surface role once. If get_xdg_surface is called with a wl_surface that already has an active xdg_surface associated with it, or if it had any other role, an error is raised.

See the documentation of xdg_surface for more details about what an xdg_surface is and how it is used.

◆ xdg_shell_get_xdg_popup()

static struct xdg_popup* xdg_shell_get_xdg_popup ( struct xdg_shell *  xdg_shell,
struct wl_surface *  surface,
struct wl_surface *  parent,
struct wl_seat *  seat,
uint32_t  serial,
int32_t  x,
int32_t  y 
)
inlinestatic

This creates an xdg_popup for the given surface and gives it the xdg_popup role.

A wl_surface can only be given an xdg_popup role once. If get_xdg_popup is called with a wl_surface that already has an active xdg_popup associated with it, or if it had any other role, an error is raised.

This request must be used in response to some sort of user action like a button press, key press, or touch down event.

See the documentation of xdg_popup for more details about what an xdg_popup is and how it is used.