CtkWindowGroup: CTK+ 3 Reference Manual

## CtkWindowGroup CtkWindowGroup — Limit the effect of grabs |

## Functions

CtkWindowGroup * | ctk_window_group_new ()
void | ctk_window_group_add_window ()
void | ctk_window_group_remove_window ()
GList * | ctk_window_group_list_windows ()
CtkWidget * | ctk_window_group_get_current_grab ()
CtkWidget * | ctk_window_group_get_current_device_grab ()

## Types and Values

| CtkWindowGroup

## Object Hierarchy

        GObject
        ╰── CtkWindowGroup

## Includes

    #include <ctk/ctk.h>

## Description

A CtkWindowGroup restricts the effect of grabs to windows in the same group, thereby making window groups almost behave like separate applications.

A window can be a member in at most one window group at a time. Windows that have not been explicitly assigned to a group are implicitly treated like windows of the default window group.

CtkWindowGroup objects are referenced by each window in the group, so once you have added all windows to a CtkWindowGroup, you can drop the initial reference to the window group with `g_object_unref()`. If the windows in the window group are subsequently destroyed, then they will be removed from the window group and drop their references on the window group; when all window have been removed, the window group will be freed.

## Functions

### ctk_window_group_new ()

    CtkWindowGroup *
    ctk_window_group_new (void);

Creates a new CtkWindowGroup object. Grabs added with `ctk_grab_add()` only affect windows within the same CtkWindowGroup.

#### Returns

a new CtkWindowGroup.

### ctk_window_group_add_window ()

    void
    ctk_window_group_add_window (CtkWindowGroup *window_group,
                                 CtkWindow *window);

Adds a window to a CtkWindowGroup.

#### Parameters

window_group | a CtkWindowGroup |
window | the CtkWindow to add |

### ctk_window_group_remove_window ()

    void
    ctk_window_group_remove_window (CtkWindowGroup *window_group,
                                    CtkWindow *window);

Removes a window from a CtkWindowGroup.

#### Parameters

window_group | a CtkWindowGroup |
window | the CtkWindow to remove |

### ctk_window_group_list_windows ()

    GList *
    ctk_window_group_list_windows (CtkWindowGroup *window_group);

Returns a list of the CtkWindows that belong to `window_group` .

#### Parameters

window_group | a CtkWindowGroup |

#### Returns

A newly-allocated list of windows inside the group.

[element-type CtkWindow][transfer container]

Since: 2.14

### ctk_window_group_get_current_grab ()

    CtkWidget *
    ctk_window_group_get_current_grab (CtkWindowGroup *window_group);

Gets the current grab widget of the given group, see `ctk_grab_add()`.

#### Parameters

window_group | a CtkWindowGroup |

#### Returns

the current grab widget of the group.

[transfer none]

Since: 2.22

### ctk_window_group_get_current_device_grab ()

    CtkWidget *
    ctk_window_group_get_current_device_grab
                                   (CtkWindowGroup *window_group,
                                    CdkDevice *device);

Returns the current grab widget for `device` , or `NULL` if none.

#### Parameters

window_group | a CtkWindowGroup |
device | a CdkDevice |

#### Returns

The grab widget, or `NULL`.

[nullable][transfer none]

Since: 3.0

## Types and Values

### CtkWindowGroup

    typedef struct _CtkWindowGroup CtkWindowGroup;