## Gdk Extensions Gdk Extensions — various extensions to Gdk |

## Stability Level

Stable, unless otherwise indicated

## Functions

GdkScreen * | xfce_gdk_screen_get_active ()
GdkRectangle * | xfce_gdk_screen_get_geometry ()
gboolean | xfce_gdk_device_grab ()

## Includes

    #include <libxfce4ui/libxfce4ui.h>

## Description

Common used functions that are not provided by the Gdk or Gdk-pixbuf library.

## Functions

### xfce_gdk_screen_get_active ()

    GdkScreen *
    xfce_gdk_screen_get_active (gint *monitor_return);

Returns the currently active GdkScreen, that is, the screen which currently contains the pointer. If no active screen was found, the default GdkScreen is returned.

#### Parameters

monitor_return | Address to store the monitor number to or `NULL`. | [out][nullable]

#### Returns

the currently active GdkScreen.

[transfer none]

### xfce_gdk_screen_get_geometry ()

    GdkRectangle *
    xfce_gdk_screen_get_geometry (void);

Returns the width and height of the default GdkScreen. This is a replacement for gdk_screen_width/gdk_screen_height.

#### Returns

a newly created GdkRectangle containing the width and height of the screen.

[transfer full]

Since: 4.14

### xfce_gdk_device_grab ()

    gboolean
    xfce_gdk_device_grab (GdkSeat *seat,
                          GdkWindow *window,
                          GdkSeatCapabilities capabilities,
                          GdkCursor *cursor);

Similar to gdk_seat_grab but tries to grab the seat five times with 100ms between each attempt.

#### Parameters

seat | A GdkSeat. |
window | The GdkWindow which will own the grab. |
capabilities | Capabilities that will be grabbed. |
cursor | The cursor to display while the grab is active. If this is `NULL` then the normal cursors are used for window and its descendants, and the cursor for window is used elsewhere. | [nullable]

#### Returns

`TRUE` on success, `FALSE` otherwise.

Since: 4.18