## Utilities Utilities — Miscellaneous windowing utilities |

## Stability Level

Unstable, unless otherwise indicated

## Functions

void | xfw_set_client_type ()
XfwWindowing | xfw_windowing_get ()
void | xfw_windowing_error_trap_push ()
gint | xfw_windowing_error_trap_pop ()
void | xfw_windowing_error_trap_pop_ignored ()

## Types and Values

#define | XFW_ERROR
enum | XfwClientType
enum | XfwError
enum | XfwWindowing
enum | XfwDirection

## Includes

    #include <libxfce4windowing/libxfce4windowing.h>

## Description

## Functions

### xfw_set_client_type ()

    void
    xfw_set_client_type (XfwClientType client_type);

Sets the type of the application. This is used when sending various messages to control the behavior of other windows, to indicate the source of the control. In general, XFW_CLIENT_TYPE_APPLICATION will be interpreted as automated control from a regular application, and XFW_CLIENT_TYPE_PAGER will be interpreted as user-initiated control from a desktop component application like a pager or dock.

This does nothing on Wayland, but is safe to call under a Wayland session.

#### Parameters

client_type | A XfwClientType |

Since: 4.19.3

### xfw_windowing_get ()

    XfwWindowing
    xfw_windowing_get (void);

Determines the windowing environment that is currently active.

#### Returns

A value from the XfwWindowing enum.

### xfw_windowing_error_trap_push ()

    void
    xfw_windowing_error_trap_push (GdkDisplay *display);

Traps errors in the underlying windowing environment. Error traps work as a stack, so for every "push" call, there needs to be a "pop" call. Multiple pushes need to be matched with an equal number of pops.

This only does anything on X11.

#### Parameters

display | a GdkDisplay. |

### xfw_windowing_error_trap_pop ()

    gint
    xfw_windowing_error_trap_pop (GdkDisplay *display);

Pops the topmost error trap off of the stack.

This only does anything on X11.

#### Parameters

display | a GdkDisplay. |

#### Returns

Returns the error code of the error that occured, or `0` if there was no error.

### xfw_windowing_error_trap_pop_ignored ()

    void
    xfw_windowing_error_trap_pop_ignored (GdkDisplay *display);

Pops the topmost error trap off of the stack.

This only does anything on X11.

#### Parameters

display | a GdkDisplay. |

## Types and Values

### XFW_ERROR

    #define XFW_ERROR (xfw_error_quark())

The error domain for all errors returned by this library.

### enum XfwClientType

The type of the application.

See `xfw_set_client_type()` for details.

#### Members

XFW_CLIENT_TYPE_APPLICATION | a regular application |
XFW_CLIENT_TYPE_PAGER | a pager or other user-controlled desktop component |

Since: 4.19.3

### enum XfwError

An error code enum describing possible errors returned by this library.

#### Members

XFW_ERROR_UNSUPPORTED | the operation attempted is not supported. |
XFW_ERROR_INTERNAL | an internal error has occurred. |

### enum XfwWindowing

Represents the windowing environment that is currently running. Note that for an application running on XWayland, this will return XFW_WINDOWING_X11.

#### Members

XFW_WINDOWING_UNKNOWN | the application is running under an unknown or unsupported windowing system. |
XFW_WINDOWING_X11 | the application is running under an X11 server. |
XFW_WINDOWING_WAYLAND | the application is running under a Wayland comopositor. |

### enum XfwDirection

Represents a direction, either of position ("This workspace is to the left of the current workspace") or movement ("Move this window to the workspace to the right of its current workspace").

#### Members

XFW_DIRECTION_UP | upward from the current location |
XFW_DIRECTION_DOWN | downward from the current location |
XFW_DIRECTION_LEFT | to the left of the current location |
XFW_DIRECTION_RIGHT | to the right of the current location |