SDL  2.0
The wl_shell_surface interface

Data Structures

struct  wl_shell_surface_listener
 

Macros

#define WL_SHELL_SURFACE_PING_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_PONG_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION   1
 
#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION   1
 

Enumerations

enum  wl_shell_surface_resize {
  WL_SHELL_SURFACE_RESIZE_NONE = 0,
  WL_SHELL_SURFACE_RESIZE_TOP = 1,
  WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,
  WL_SHELL_SURFACE_RESIZE_LEFT = 4,
  WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,
  WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,
  WL_SHELL_SURFACE_RESIZE_RIGHT = 8,
  WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,
  WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10
}
 
enum  wl_shell_surface_transient { WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1 }
 
enum  wl_shell_surface_fullscreen_method {
  WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,
  WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,
  WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,
  WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3
}
 

Functions

static int wl_shell_surface_add_listener (struct wl_shell_surface *wl_shell_surface, const struct wl_shell_surface_listener *listener, void *data)
 
static void wl_shell_surface_set_user_data (struct wl_shell_surface *wl_shell_surface, void *user_data)
 
static voidwl_shell_surface_get_user_data (struct wl_shell_surface *wl_shell_surface)
 
static void wl_shell_surface_destroy (struct wl_shell_surface *wl_shell_surface)
 
static void wl_shell_surface_pong (struct wl_shell_surface *wl_shell_surface, uint32_t serial)
 
static void wl_shell_surface_move (struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial)
 
static void wl_shell_surface_resize (struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
 
static void wl_shell_surface_set_toplevel (struct wl_shell_surface *wl_shell_surface)
 
static void wl_shell_surface_set_transient (struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
 
static void wl_shell_surface_set_fullscreen (struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output)
 
static void wl_shell_surface_set_popup (struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
 
static void wl_shell_surface_set_maximized (struct wl_shell_surface *wl_shell_surface, struct wl_output *output)
 
static void wl_shell_surface_set_title (struct wl_shell_surface *wl_shell_surface, const char *title)
 
static void wl_shell_surface_set_class (struct wl_shell_surface *wl_shell_surface, const char *class_)
 

Detailed Description

An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface.

It provides requests to treat surfaces like toplevel, fullscreen or popup windows, move, resize or maximize them, associate metadata like title and class, etc.

On the server side the object is automatically destroyed when the related wl_surface is destroyed. On the client side, wl_shell_surface_destroy() must be called before destroying the wl_surface object.

Macro Definition Documentation

◆ WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION

#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION   1

Definition at line 2965 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_MOVE_SINCE_VERSION

#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION   1

Definition at line 2978 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_PING_SINCE_VERSION

#define WL_SHELL_SURFACE_PING_SINCE_VERSION   1

Definition at line 2961 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_PONG_SINCE_VERSION

#define WL_SHELL_SURFACE_PONG_SINCE_VERSION   1

Definition at line 2974 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION

#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION   1

Definition at line 2969 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_RESIZE_SINCE_VERSION

#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION   1

Definition at line 2982 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION

#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION   1

Definition at line 3010 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION

#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION   1

Definition at line 2994 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION

#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION   1

Definition at line 3002 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION

#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION   1

Definition at line 2998 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION

#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION   1

Definition at line 3006 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION

#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION   1

Definition at line 2986 of file wayland-client-protocol.h.

◆ WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION

#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION   1

Definition at line 2990 of file wayland-client-protocol.h.

Enumeration Type Documentation

◆ wl_shell_surface_fullscreen_method

different method to set the surface fullscreen

Hints to indicate to the compositor how to deal with a conflict between the dimensions of the surface and the dimensions of the output. The compositor is free to ignore this parameter.

Enumerator
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT 

no preference, apply default policy

WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE 

scale, preserve the surface's aspect ratio and center on output

WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER 

switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch

WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL 

no upscaling, center on output and add black borders to compensate size mismatch

Definition at line 2861 of file wayland-client-protocol.h.

2861  {
2862  /**
2863  * no preference, apply default policy
2864  */
2866  /**
2867  * scale, preserve the surface's aspect ratio and center on output
2868  */
2870  /**
2871  * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
2872  */
2874  /**
2875  * no upscaling, center on output and add black borders to compensate size mismatch
2876  */
2878 };

◆ wl_shell_surface_resize

edge values for resizing

These values are used to indicate which edge of a surface is being dragged in a resize operation. The server may use this information to adapt its behavior, e.g. choose an appropriate cursor image.

Enumerator
WL_SHELL_SURFACE_RESIZE_NONE 

no edge

WL_SHELL_SURFACE_RESIZE_TOP 

top edge

WL_SHELL_SURFACE_RESIZE_BOTTOM 

bottom edge

WL_SHELL_SURFACE_RESIZE_LEFT 

left edge

WL_SHELL_SURFACE_RESIZE_TOP_LEFT 

top and left edges

WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT 

bottom and left edges

WL_SHELL_SURFACE_RESIZE_RIGHT 

right edge

WL_SHELL_SURFACE_RESIZE_TOP_RIGHT 

top and right edges

WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT 

bottom and right edges

Definition at line 2794 of file wayland-client-protocol.h.

2794  {
2795  /**
2796  * no edge
2797  */
2799  /**
2800  * top edge
2801  */
2803  /**
2804  * bottom edge
2805  */
2807  /**
2808  * left edge
2809  */
2811  /**
2812  * top and left edges
2813  */
2815  /**
2816  * bottom and left edges
2817  */
2819  /**
2820  * right edge
2821  */
2823  /**
2824  * top and right edges
2825  */
2827  /**
2828  * bottom and right edges
2829  */
2831 };

◆ wl_shell_surface_transient

details of transient behaviour

These flags specify details of the expected behaviour of transient surfaces. Used in the set_transient request.

Enumerator
WL_SHELL_SURFACE_TRANSIENT_INACTIVE 

do not set keyboard focus

Definition at line 2843 of file wayland-client-protocol.h.

2843  {
2844  /**
2845  * do not set keyboard focus
2846  */
2848 };

Function Documentation

◆ wl_shell_surface_add_listener()

static int wl_shell_surface_add_listener ( struct wl_shell_surface *  wl_shell_surface,
const struct wl_shell_surface_listener listener,
void data 
)
inlinestatic

Definition at line 2940 of file wayland-client-protocol.h.

2942 {
2943  return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface,
2944  (void (**)(void)) listener, data);
2945 }
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974

◆ wl_shell_surface_destroy()

static void wl_shell_surface_destroy ( struct wl_shell_surface *  wl_shell_surface)
inlinestatic

Definition at line 3034 of file wayland-client-protocol.h.

3035 {
3036  wl_proxy_destroy((struct wl_proxy *) wl_shell_surface);
3037 }

◆ wl_shell_surface_get_user_data()

static void* wl_shell_surface_get_user_data ( struct wl_shell_surface *  wl_shell_surface)
inlinestatic

Definition at line 3021 of file wayland-client-protocol.h.

3022 {
3023  return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface);
3024 }

◆ wl_shell_surface_move()

static void wl_shell_surface_move ( struct wl_shell_surface *  wl_shell_surface,
struct wl_seat *  seat,
uint32_t  serial 
)
inlinestatic

Start a pointer-driven move of the surface.

This request must be used in response to a button press event. The server may ignore move requests depending on the state of the surface (e.g. fullscreen or maximized).

Definition at line 3062 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_MOVE.

3063 {
3064  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3065  WL_SHELL_SURFACE_MOVE, seat, serial);
3066 }
#define WL_SHELL_SURFACE_MOVE

◆ wl_shell_surface_pong()

static void wl_shell_surface_pong ( struct wl_shell_surface *  wl_shell_surface,
uint32_t  serial 
)
inlinestatic

A client must respond to a ping event with a pong request or the client may be deemed unresponsive.

Definition at line 3046 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_PONG.

3047 {
3048  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3049  WL_SHELL_SURFACE_PONG, serial);
3050 }
#define WL_SHELL_SURFACE_PONG

◆ wl_shell_surface_resize()

static void wl_shell_surface_resize ( struct wl_shell_surface *  wl_shell_surface,
struct wl_seat *  seat,
uint32_t  serial,
uint32_t  edges 
)
inlinestatic

Start a pointer-driven resizing of the surface.

This request must be used in response to a button press event. The server may ignore resize requests depending on the state of the surface (e.g. fullscreen or maximized).

Definition at line 3078 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_RESIZE.

3079 {
3080  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3081  WL_SHELL_SURFACE_RESIZE, seat, serial, edges);
3082 }
#define WL_SHELL_SURFACE_RESIZE

◆ wl_shell_surface_set_class()

static void wl_shell_surface_set_class ( struct wl_shell_surface *  wl_shell_surface,
const char *  class_ 
)
inlinestatic

Set a class for the surface.

The surface class identifies the general class of applications to which the surface belongs. A common convention is to use the file name (or the full path if it is a non-standard location) of the application's .desktop file as the class.

Definition at line 3248 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_SET_CLASS.

3249 {
3250  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3251  WL_SHELL_SURFACE_SET_CLASS, class_);
3252 }
#define WL_SHELL_SURFACE_SET_CLASS

◆ wl_shell_surface_set_fullscreen()

static void wl_shell_surface_set_fullscreen ( struct wl_shell_surface *  wl_shell_surface,
uint32_t  method,
uint32_t  framerate,
struct wl_output *  output 
)
inlinestatic

Map the surface as a fullscreen surface.

If an output parameter is given then the surface will be made fullscreen on that output. If the client does not specify the output then the compositor will apply its policy - usually choosing the output on which the surface has the biggest surface area.

The client may specify a method to resolve a size conflict between the output size and the surface size - this is provided through the method parameter.

The framerate parameter is used only when the method is set to "driver", to indicate the preferred framerate. A value of 0 indicates that the client does not care about framerate. The framerate is specified in mHz, that is framerate of 60000 is 60Hz.

A method of "scale" or "driver" implies a scaling operation of the surface, either via a direct scaling operation or a change of the output mode. This will override any kind of output scaling, so that mapping a surface with a buffer size equal to the mode can fill the screen independent of buffer_scale.

A method of "fill" means we don't scale up the buffer, however any output scale is applied. This means that you may run into an edge case where the application maps a buffer with the same size of the output mode but buffer_scale 1 (thus making a surface larger than the output). In this case it is allowed to downscale the results to fit the screen.

The compositor must reply to this request with a configure event with the dimensions for the output on which the surface will be made fullscreen.

Definition at line 3154 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_SET_FULLSCREEN.

3155 {
3156  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3157  WL_SHELL_SURFACE_SET_FULLSCREEN, method, framerate, output);
3158 }
#define WL_SHELL_SURFACE_SET_FULLSCREEN

◆ wl_shell_surface_set_maximized()

static void wl_shell_surface_set_maximized ( struct wl_shell_surface *  wl_shell_surface,
struct wl_output *  output 
)
inlinestatic

Map the surface as a maximized surface.

If an output parameter is given then the surface will be maximized on that output. If the client does not specify the output then the compositor will apply its policy - usually choosing the output on which the surface has the biggest surface area.

The compositor will reply with a configure event telling the expected new surface size. The operation is completed on the next buffer attach to this surface.

A maximized surface typically fills the entire output it is bound to, except for desktop elements such as panels. This is the main difference between a maximized shell surface and a fullscreen shell surface.

The details depend on the compositor implementation.

Definition at line 3213 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_SET_MAXIMIZED.

3214 {
3215  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3217 }
#define WL_SHELL_SURFACE_SET_MAXIMIZED

◆ wl_shell_surface_set_popup()

static void wl_shell_surface_set_popup ( struct wl_shell_surface *  wl_shell_surface,
struct wl_seat *  seat,
uint32_t  serial,
struct wl_surface *  parent,
int32_t  x,
int32_t  y,
uint32_t  flags 
)
inlinestatic

Map the surface as a popup.

A popup surface is a transient surface with an added pointer grab.

An existing implicit grab will be changed to owner-events mode, and the popup grab will continue after the implicit grab ends (i.e. releasing the mouse button does not cause the popup to be unmapped).

The popup grab continues until the window is destroyed or a mouse button is pressed in any other client's window. A click in any of the client's surfaces is reported as normal, however, clicks in other clients' surfaces will be discarded and trigger the callback.

The x and y arguments specify the location of the upper left corner of the surface relative to the upper left corner of the parent surface, in surface-local coordinates.

Definition at line 3184 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_SET_POPUP.

3185 {
3186  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3187  WL_SHELL_SURFACE_SET_POPUP, seat, serial, parent, x, y, flags);
3188 }
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
GLbitfield flags
#define WL_SHELL_SURFACE_SET_POPUP

◆ wl_shell_surface_set_title()

static void wl_shell_surface_set_title ( struct wl_shell_surface *  wl_shell_surface,
const char *  title 
)
inlinestatic

Set a short title for the surface.

This string may be used to identify the surface in a task bar, window list, or other user interface elements provided by the compositor.

The string must be encoded in UTF-8.

Definition at line 3231 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_SET_TITLE.

3232 {
3233  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3235 }
#define WL_SHELL_SURFACE_SET_TITLE

◆ wl_shell_surface_set_toplevel()

static void wl_shell_surface_set_toplevel ( struct wl_shell_surface *  wl_shell_surface)
inlinestatic

Map the surface as a toplevel surface.

A toplevel surface is not fullscreen, maximized or transient.

Definition at line 3092 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_SET_TOPLEVEL.

3093 {
3094  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3096 }
#define WL_SHELL_SURFACE_SET_TOPLEVEL

◆ wl_shell_surface_set_transient()

static void wl_shell_surface_set_transient ( struct wl_shell_surface *  wl_shell_surface,
struct wl_surface *  parent,
int32_t  x,
int32_t  y,
uint32_t  flags 
)
inlinestatic

Map the surface relative to an existing surface.

The x and y arguments specify the location of the upper left corner of the surface relative to the upper left corner of the parent surface, in surface-local coordinates.

The flags argument controls details of the transient behaviour.

Definition at line 3110 of file wayland-client-protocol.h.

References WL_SHELL_SURFACE_SET_TRANSIENT.

3111 {
3112  wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
3114 }
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
#define WL_SHELL_SURFACE_SET_TRANSIENT
GLbitfield flags

◆ wl_shell_surface_set_user_data()

static void wl_shell_surface_set_user_data ( struct wl_shell_surface *  wl_shell_surface,
void user_data 
)
inlinestatic

Definition at line 3014 of file wayland-client-protocol.h.

3015 {
3016  wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data);
3017 }