## WnckApplication

WnckApplication — an object representing a group of windows of the same application.

## Stability Level

Unstable, unless otherwise indicated

## Functions

WnckApplication * | wnck_application_get ()
gulong | wnck_application_get_xid ()
GList * | wnck_application_get_windows ()
int | wnck_application_get_n_windows ()
const char * | wnck_application_get_name ()
const char * | wnck_application_get_icon_name ()
int | wnck_application_get_pid ()
GdkPixbuf * | wnck_application_get_icon ()
GdkPixbuf * | wnck_application_get_mini_icon ()
gboolean | wnck_application_get_icon_is_fallback ()
const char * | wnck_application_get_startup_id ()

## Signals

void | icon-changed | Run Last
void | name-changed | Run Last

## Types and Values

| WnckApplication

## Object Hierarchy

        GObject
        ╰── WnckApplication

## Description

The WnckApplication is a group of WnckWindow that are all in the same application. It can be used to represent windows by applications, group windows by applications or to manipulate all windows of a particular application.

A WnckApplication is identified by the group leader of the WnckWindow belonging to it, and new WnckWindow are added to a WnckApplication if and only if they have the group leader of the WnckApplication.

The WnckApplication objects are always owned by libwnck and must not be referenced or unreferenced.

## Functions

### wnck_application_get ()

    WnckApplication *
    wnck_application_get (gulong xwindow);

`wnck_application_get` is deprecated and should not be used in newly-written code.

Gets the WnckApplication corresponding to the group leader with `xwindow` as X window ID.

#### Parameters

xwindow | the X window ID of a group leader. |

#### Returns

the WnckApplication corresponding to `xwindow` , or `NULL` if there no such WnckApplication could be found. The returned WnckApplication is owned by libwnck and must not be referenced or unreferenced.

[transfer none]

### wnck_application_get_xid ()

    gulong
    wnck_application_get_xid (WnckApplication *app);

Gets the X window ID of the group leader window for `app` .

#### Parameters

app | a WnckApplication. |

#### Returns

the X window ID of the group leader window for `app` .

### wnck_application_get_windows ()

    GList *
    wnck_application_get_windows (WnckApplication *app);

Gets the list of WnckWindow belonging to `app` .

#### Parameters

app | a WnckApplication. |

#### Returns

the list of WnckWindow belonging to `app` , or `NULL` if the application contains no window. The list should not be modified nor freed, as it is owned by `app` .

[element-type WnckWindow][transfer none]

### wnck_application_get_n_windows ()

    int
    wnck_application_get_n_windows (WnckApplication *app);

Gets the number of WnckWindow belonging to `app` .

#### Parameters

app | a WnckApplication. |

#### Returns

the number of WnckWindow belonging to `app` .

### wnck_application_get_name ()

    const char *
    wnck_application_get_name (WnckApplication *app);

Gets the name of `app` . Since there is no way to properly find this name, various suboptimal heuristics are used to find it. GTK+ should probably have a function to allow applications to set the _NET_WM_NAME property on the group leader as the application name, and the EWMH should say that this is where the application name goes.

#### Parameters

app | a WnckApplication. |

#### Returns

the name of `app` , or a fallback name if no name is available.

### wnck_application_get_icon_name ()

    const char *
    wnck_application_get_icon_name (WnckApplication *app);

Gets the icon name of `app` (to be used when `app` is minimized). Since there is no way to properly find this name, various suboptimal heuristics are used to find it.

#### Parameters

app | a WnckApplication |

#### Returns

the icon name of `app` , or a fallback icon name if no icon name is available.

### wnck_application_get_pid ()

    int
    wnck_application_get_pid (WnckApplication *app);

Gets the process ID of `app` .

#### Parameters

app | a WnckApplication. |

#### Returns

the process ID of `app` , or 0 if none is available.

### wnck_application_get_icon ()

    GdkPixbuf *
    wnck_application_get_icon (WnckApplication *app);

Gets the icon to be used for `app` . If no icon is set for `app` , a suboptimal heuristic is used to find an appropriate icon. If no icon was found, a fallback icon is used.

#### Parameters

app | a WnckApplication. |

#### Returns

the icon for `app` . The caller should reference the returned `GdkPixbuf` if it needs to keep the icon around.

[transfer none]

### wnck_application_get_mini_icon ()

    GdkPixbuf *
    wnck_application_get_mini_icon (WnckApplication *app);

Gets the mini-icon to be used for `app` . If no mini-icon is set for `app` , a suboptimal heuristic is used to find an appropriate icon. If no mini-icon was found, a fallback mini-icon is used.

#### Parameters

app | a WnckApplication. |

#### Returns

the mini-icon for `app` . The caller should reference the returned `GdkPixbuf` if it needs to keep the mini-icon around.

[transfer none]

### wnck_application_get_icon_is_fallback ()

    gboolean
    wnck_application_get_icon_is_fallback (WnckApplication *app);

Gets whether a default fallback icon is used for `app` (because none was set on `app` ).

#### Parameters

app | a WnckApplication |

#### Returns

`TRUE` if the icon for `app` is a fallback, `FALSE` otherwise.

### wnck_application_get_startup_id ()

    const char *
    wnck_application_get_startup_id (WnckApplication *app);

Gets the startup sequence ID used for startup notification of `app` .

#### Parameters

app | a WnckApplication. |

#### Returns

the startup sequence ID used for startup notification of `app` , or `NULL` if none is available.

Since: 2.2

## Types and Values

### WnckApplication

    typedef struct _WnckApplication WnckApplication;

The WnckApplication struct contains only private fields and should not be directly accessed.

## Signal Details

### The `“icon-changed”` signal

    void
    user_function (WnckApplication *app,
                   gpointer         user_data)

Emitted when the icon of `app` changes.

#### Parameters

app | the WnckApplication which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

### The `“name-changed”` signal

    void
    user_function (WnckApplication *app,
                   gpointer         user_data)

Emitted when the name of `app` changes.

#### Parameters

app | the WnckApplication which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

## See Also

wnck_window_get_application()