WnckWindow: Libwnck Reference Manual

## WnckWindow WnckWindow — an object representing a window. |

## Stability Level

Unstable, unless otherwise indicated

## Functions

WnckWindow * | wnck_window_get ()
WnckScreen * | wnck_window_get_screen ()
gboolean | wnck_window_has_name ()
const char * | wnck_window_get_name ()
gboolean | wnck_window_has_icon_name ()
const char * | wnck_window_get_icon_name ()
gboolean | wnck_window_get_icon_is_fallback ()
GdkPixbuf * | wnck_window_get_icon ()
GdkPixbuf * | wnck_window_get_mini_icon ()
WnckApplication * | wnck_window_get_application ()
WnckWindow * | wnck_window_get_transient ()
gulong | wnck_window_get_group_leader ()
gulong | wnck_window_get_xid ()
WnckClassGroup * | wnck_window_get_class_group ()
const char * | wnck_window_get_class_group_name ()
const char * | wnck_window_get_class_instance_name ()
const char * | wnck_window_get_session_id ()
const char * | wnck_window_get_session_id_utf8 ()
int | wnck_window_get_pid ()
gint | wnck_window_get_sort_order ()
void | wnck_window_set_sort_order ()
WnckWindowType | wnck_window_get_window_type ()
void | wnck_window_set_window_type ()
WnckWindowState | wnck_window_get_state ()
gboolean | wnck_window_is_minimized ()
gboolean | wnck_window_is_maximized_horizontally ()
gboolean | wnck_window_is_maximized_vertically ()
gboolean | wnck_window_is_maximized ()
gboolean | wnck_window_is_shaded ()
gboolean | wnck_window_is_pinned ()
gboolean | wnck_window_is_sticky ()
gboolean | wnck_window_is_above ()
gboolean | wnck_window_is_below ()
gboolean | wnck_window_is_skip_pager ()
gboolean | wnck_window_is_skip_tasklist ()
gboolean | wnck_window_is_fullscreen ()
gboolean | wnck_window_needs_attention ()
gboolean | wnck_window_or_transient_needs_attention ()
WnckWindowActions | wnck_window_get_actions ()
void | wnck_window_minimize ()
void | wnck_window_unminimize ()
void | wnck_window_maximize_horizontally ()
void | wnck_window_unmaximize_horizontally ()
void | wnck_window_maximize_vertically ()
void | wnck_window_unmaximize_vertically ()
void | wnck_window_maximize ()
void | wnck_window_unmaximize ()
void | wnck_window_shade ()
void | wnck_window_unshade ()
void | wnck_window_pin ()
void | wnck_window_unpin ()
void | wnck_window_stick ()
void | wnck_window_unstick ()
void | wnck_window_make_above ()
void | wnck_window_unmake_above ()
void | wnck_window_make_below ()
void | wnck_window_unmake_below ()
void | wnck_window_set_skip_pager ()
void | wnck_window_set_skip_tasklist ()
void | wnck_window_set_fullscreen ()
void | wnck_window_close ()
WnckWorkspace * | wnck_window_get_workspace ()
gboolean | wnck_window_is_on_workspace ()
gboolean | wnck_window_is_visible_on_workspace ()
void | wnck_window_move_to_workspace ()
gboolean | wnck_window_is_in_viewport ()
void | wnck_window_activate ()
gboolean | wnck_window_is_active ()
gboolean | wnck_window_is_most_recently_activated ()
void | wnck_window_activate_transient ()
gboolean | wnck_window_transient_is_most_recently_activated ()
void | wnck_window_set_icon_geometry ()
void | wnck_window_get_client_window_geometry ()
void | wnck_window_get_geometry ()
void | wnck_window_set_geometry ()
void | wnck_window_keyboard_move ()
void | wnck_window_keyboard_size ()

## Signals

void | actions-changed | Run Last
void | class-changed | Run Last
void | geometry-changed | Run Last
void | icon-changed | Run Last
void | name-changed | Run Last
void | role-changed | Run Last
void | state-changed | Run Last
void | type-changed | Run Last
void | workspace-changed | Run Last

## Types and Values

| WnckWindow
enum | WnckWindowType
enum | WnckWindowState
enum | WnckWindowActions
enum | WnckWindowGravity
enum | WnckWindowMoveResizeMask

## Object Hierarchy

        GObject
        ╰── WnckWindow

## Includes

    #include <libwnck/libwnck.h>

## Description

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

## Functions

### wnck_window_get ()

    WnckWindow *
    wnck_window_get (gulong xwindow);

Gets a preexisting WnckWindow for the X window `xwindow` . This will not create a WnckWindow if none exists. The function is robust against bogus window IDs.

#### Parameters

xwindow | an X window ID. |

#### Returns

the WnckWindow for `xwindow` . The returned WnckWindow is owned by libwnck and must not be referenced or unreferenced.

[transfer none]

### wnck_window_get_screen ()

    WnckScreen *
    wnck_window_get_screen (WnckWindow *window);

Gets the WnckScreen `window` is on.

#### Parameters

window | a WnckWindow. |

#### Returns

the WnckScreen `window` is on. The returned WnckScreen is owned by libwnck and must not be referenced or unreferenced.

[transfer none]

### wnck_window_has_name ()

    gboolean
    wnck_window_has_name (WnckWindow *window);

Checks whether or not `window` has a name. `wnck_window_get_name()` will always return some value, even if `window` has no name set; `wnck_window_has_name()` can be used to tell if that name is real or not.

For icons titles, use `wnck_window_has_icon_name()` instead.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `wnck_window_get_name()` returns `window` 's name, `FALSE` if it returns a fallback name.

Since: 2.16

### wnck_window_get_name ()

    const char *
    wnck_window_get_name (WnckWindow *window);

Gets the name of `window` , as it should be displayed in a pager or tasklist. Always returns some value, even if `window` has no name set; use `wnck_window_has_name()` if you need to know whether the returned name is "real" or not.

For icons titles, use `wnck_window_get_icon_name()` instead.

#### Parameters

window | a WnckWindow. |

#### Returns

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

### wnck_window_has_icon_name ()

    gboolean
    wnck_window_has_icon_name (WnckWindow *window);

Checks whether or not `window` has an icon name. `wnck_window_get_icon_name()` will always return some value, even if `window` has no icon name set; `wnck_window_has_icon_name()` can be used to tell if that icon name is real or not.

(Note that if `wnck_window_has_icon_name()` returns `FALSE`, but `wnck_window_has_name()` returns `TRUE`, then the name returned by `wnck_window_get_icon_name()` is `window` 's name. Only when both methods return `FALSE` does `wnck_window_get_icon_name()` return a generic fallback name.)

#### Parameters

window | a WnckWindow |

#### Returns

`TRUE` if `wnck_window_get_icon_name()` returns `window` 's icon name, `FALSE` if it returns a fallback name.

Since: 2.16

### wnck_window_get_icon_name ()

    const char *
    wnck_window_get_icon_name (WnckWindow *window);

Gets the icon name of `window` , as it should be displayed for an icon (minimized state). Always returns some value, even if `window` has no icon name set; use `wnck_window_has_icon_name()` if you need to know whether the returned icon name is "real" or not.

Contrast with `wnck_window_get_name()`, which returns `window` 's title, not its icon title.

#### Parameters

window | a WnckWindow |

#### Returns

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

### wnck_window_get_icon_is_fallback ()

    gboolean
    wnck_window_get_icon_is_fallback (WnckWindow *window);

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

#### Parameters

window | a WnckWindow. |

#### Returns

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

### wnck_window_get_icon ()

    GdkPixbuf *
    wnck_window_get_icon (WnckWindow *window);

Gets the icon to be used for `window` . If no icon was found, a fallback icon is used. `wnck_window_get_icon_is_fallback()` can be used to tell if the icon is the fallback icon.

#### Parameters

window | a WnckWindow. |

#### Returns

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

[transfer none]

### wnck_window_get_mini_icon ()

    GdkPixbuf *
    wnck_window_get_mini_icon (WnckWindow *window);

Gets the mini-icon to be used for `window` . If no mini-icon was found, a fallback mini-icon is used. `wnck_window_get_icon_is_fallback()` can be used to tell if the mini-icon is the fallback mini-icon.

#### Parameters

window | a WnckWindow. |

#### Returns

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

[transfer none]

### wnck_window_get_application ()

    WnckApplication *
    wnck_window_get_application (WnckWindow *window);

Gets the WnckApplication to which `window` belongs.

#### Parameters

window | a WnckWindow. |

#### Returns

the WnckApplication to which `window` belongs. The returned WnckApplication is owned by libwnck and must not be referenced or unreferenced.

[transfer none]

### wnck_window_get_transient ()

    WnckWindow *
    wnck_window_get_transient (WnckWindow *window);

Gets the WnckWindow for which `window` is transient.

#### Parameters

window | a WnckWindow. |

#### Returns

the WnckWindow for which `window` is transient, or `NULL` if `window` is not transient for any WnckWindow. The returned WnckWindow is owned by libwnck and must not be referenced or unreferenced.

[transfer none]

Since: 2.12

### wnck_window_get_group_leader ()

    gulong
    wnck_window_get_group_leader (WnckWindow *window);

Gets the group leader of the group of windows to which `window` belongs.

#### Parameters

window | a WnckWindow. |

#### Returns

the group leader of the group of windows to which `window` belongs, or the X window ID of `window` if `window` does not belong to any group.

### wnck_window_get_xid ()

    gulong
    wnck_window_get_xid (WnckWindow *window);

Gets the X window ID of `window` .

#### Parameters

window | a WnckWindow. |

#### Returns

the X window ID of `window` .

### wnck_window_get_class_group ()

    WnckClassGroup *
    wnck_window_get_class_group (WnckWindow *window);

Gets the WnckClassGroup to which `window` belongs.

#### Parameters

window | a WnckWindow. |

#### Returns

the WnckClassGroup to which `window` belongs. The returned WnckClassGroup is owned by libwnck and must not be referenced or unreferenced.

[transfer none]

Since: 2.2

### wnck_window_get_class_group_name ()

    const char *
    wnck_window_get_class_group_name (WnckWindow *window);

Gets the class group name from the WM_CLASS Property for `window` .

The class group name is also the identifier name of the WnckClassGroup to which `window` belongs.

#### Parameters

window | a WnckWindow. |

#### Returns

the class group name for `window` , or `NULL` if `window` belongs to no class group.

### wnck_window_get_class_instance_name ()

    const char *
    wnck_window_get_class_instance_name (WnckWindow *window);

Gets the class instance name from the WM_CLASS Property for `window` .

The class instance name allows to differentiate windows belonging to the same class group, so that they can use different resources.

#### Parameters

window | a WnckWindow. |

#### Returns

the class instance name for `window` , or `NULL` if `window` has no class instance.

### wnck_window_get_session_id ()

    const char *
    wnck_window_get_session_id (WnckWindow *window);

Gets the session ID for `window` in Latin-1 encoding. NOTE: this is invalid UTF-8. You can't display this string in a GTK+ widget without converting to UTF-8. See `wnck_window_get_session_id_utf8()`.

#### Parameters

window | a WnckWindow. |

#### Returns

the session ID for `window` in Latin-1, or `NULL` if `window` has no session ID.

### wnck_window_get_session_id_utf8 ()

    const char *
    wnck_window_get_session_id_utf8 (WnckWindow *window);

Gets the session ID for `window` in UTF-8 encoding. The session ID should be in Latin-1 encoding, so the conversion should work, but a broken client could set a session ID that might not be convertable to UTF-8.

#### Parameters

window | a WnckWindow. |

#### Returns

the session ID for `window` in UTF-8, or `NULL` if `window` has no session ID.

### wnck_window_get_pid ()

    int
    wnck_window_get_pid (WnckWindow *window);

Gets the process ID of `window` .

#### Parameters

window | a WnckWindow. |

#### Returns

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

### wnck_window_get_sort_order ()

    gint
    wnck_window_get_sort_order (WnckWindow *window);

Gets the sort order of `window` , used for ordering of `window` in WnckSelector and WnckTasklist. The sort order is an internal state in libwnck. The initial value is defined when the window is created.

#### Parameters

window | a WnckWindow. |

#### Returns

the sort order of `window` , or G_MAXINT if none is available.

Since: 2.10

### wnck_window_set_sort_order ()

    void
    wnck_window_set_sort_order (WnckWindow *window,
                                gint order);

Sets the sort order of `window` . The sort order is used for ordering of `window` in WnckSelector and WnckTasklist.

#### Parameters

window | a WnckWindow. |
order | new sort order for `window` . |

Since: 2.20

### wnck_window_get_window_type ()

    WnckWindowType
    wnck_window_get_window_type (WnckWindow *window);

Gets the semantic type of `window` .

#### Parameters

window | a WnckWindow. |

#### Returns

the semantic type of `window` .

### wnck_window_set_window_type ()

    void
    wnck_window_set_window_type (WnckWindow *window,
                                 WnckWindowType wintype);

Sets the semantic type of `window` to `wintype` .

#### Parameters

window | a WnckWindow. |
wintype | a semantic type. |

Since: 2.12

### wnck_window_get_state ()

    WnckWindowState
    wnck_window_get_state (WnckWindow *window);

Gets the state of `window` .

#### Parameters

window | a WnckWindow. |

#### Returns

bitmask of active states for `window` .

### wnck_window_is_minimized ()

    gboolean
    wnck_window_is_minimized (WnckWindow *window);

Gets whether `window` is minimized. Minimization state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is minimized, `FALSE` otherwise.

### wnck_window_is_maximized_horizontally ()

    gboolean
    wnck_window_is_maximized_horizontally (WnckWindow *window);

Gets whether `window` is maximized horizontally. Horizontal maximization state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is maximized horizontally, `FALSE` otherwise.

### wnck_window_is_maximized_vertically ()

    gboolean
    wnck_window_is_maximized_vertically (WnckWindow *window);

Gets whether `window` is maximized vertically. vertiVal maximization state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is maximized vertically, `FALSE` otherwise.

### wnck_window_is_maximized ()

    gboolean
    wnck_window_is_maximized (WnckWindow *window);

Gets whether `window` is maximized. Maximization state may change anytime a “state-changed” signal gets emitted.

As for GDK, "maximized" means both vertically and horizontally. If `window` is maximized in only one direction, then `window` is not considered maximized.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is maximized in both directions, `FALSE` otherwise.

### wnck_window_is_shaded ()

    gboolean
    wnck_window_is_shaded (WnckWindow *window);

Gets whether `window` is shaded. Shade state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is shaded, `FALSE` otherwise.

### wnck_window_is_pinned ()

    gboolean
    wnck_window_is_pinned (WnckWindow *window);

Gets whether `window` is on all workspace. Pinned state may change anytime a “workspace-changed” signal gets emitted, but not when a “state-changed” gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is on all workspaces, `FALSE` otherwise.

### wnck_window_is_sticky ()

    gboolean
    wnck_window_is_sticky (WnckWindow *window);

Gets whether `window` is sticky. Sticky state may change anytime a “state-changed” signal gets emitted.

Sticky here means "stuck to the glass", i.e. does not scroll with the viewport. In GDK/GTK+ (e.g. `gdk_window_stick()`/`gtk_window_stick()`), sticky means "stuck to the glass" and also that the window is on all workspaces. But here it only means the viewport aspect of it.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is "stuck to the glass", `FALSE` otherwise.

### wnck_window_is_above ()

    gboolean
    wnck_window_is_above (WnckWindow *window);

Gets whether `window` is above other windows. This state may change anytime a “state-changed” signal gets emitted.

See `wnck_window_make_above()` for more details on this state.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is above other windows, `FALSE` otherwise.

Since: 2.14

### wnck_window_is_below ()

    gboolean
    wnck_window_is_below (WnckWindow *window);

Gets whether `window` is below other windows. This state may change anytime a “state-changed” signal gets emitted.

See `wnck_window_make_below()` for more details on this state.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is below other windows, `FALSE` otherwise.

Since: 2.20

### wnck_window_is_skip_pager ()

    gboolean
    wnck_window_is_skip_pager (WnckWindow *window);

Gets whether `window` is included on pagers. This state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is included on pagers, `FALSE` otherwise.

### wnck_window_is_skip_tasklist ()

    gboolean
    wnck_window_is_skip_tasklist (WnckWindow *window);

Gets whether `window` is included on tasklists. This state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is included on tasklists, `FALSE` otherwise.

### wnck_window_is_fullscreen ()

    gboolean
    wnck_window_is_fullscreen (WnckWindow *window);

Gets whether `window` is fullscreen. Fullscreen state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is fullscreen, `FALSE` otherwise.

Since: 2.8

### wnck_window_needs_attention ()

    gboolean
    wnck_window_needs_attention (WnckWindow *window);

Gets whether `window` needs attention. This state may change anytime a “state-changed” signal gets emitted.

This state depends on flags such as the demands_attention and is_urgent hints.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` needs attention, `FALSE` otherwise.

Since: 2.12

### wnck_window_or_transient_needs_attention ()

    gboolean
    wnck_window_or_transient_needs_attention
                                   (WnckWindow *window);

Gets whether `window` or one of its transients needs attention. This state may change anytime a “state-changed” signal gets emitted.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` or one of its transients needs attention, `FALSE` otherwise.

Since: 2.12

### wnck_window_get_actions ()

    WnckWindowActions
    wnck_window_get_actions (WnckWindow *window);

Gets the actions that can be done for `window` .

#### Parameters

window | a WnckWindow. |

#### Returns

bitmask of actions that can be done for `window` .

### wnck_window_minimize ()

    void
    wnck_window_minimize (WnckWindow *window);

Minimizes `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_unminimize ()

    void
    wnck_window_unminimize (WnckWindow *window,
                            guint32 timestamp);

Unminimizes `window` by activating it or one of its transients. See `wnck_window_activate_transient()` for details on how the activation is done.

#### Parameters

window | a WnckWindow. |
timestamp | the X server timestamp of the user interaction event that caused this call to occur. |

### wnck_window_maximize_horizontally ()

    void
    wnck_window_maximize_horizontally (WnckWindow *window);

Asks the window manager to maximize horizontally `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_unmaximize_horizontally ()

    void
    wnck_window_unmaximize_horizontally (WnckWindow *window);

Asks the window manager to unmaximize horizontally `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_maximize_vertically ()

    void
    wnck_window_maximize_vertically (WnckWindow *window);

Asks the window manager to maximize vertically `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_unmaximize_vertically ()

    void
    wnck_window_unmaximize_vertically (WnckWindow *window);

Asks the window manager to unmaximize vertically `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_maximize ()

    void
    wnck_window_maximize (WnckWindow *window);

Asks the window manager to maximize `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_unmaximize ()

    void
    wnck_window_unmaximize (WnckWindow *window);

Asks the window manager to unmaximize `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_shade ()

    void
    wnck_window_shade (WnckWindow *window);

Asks the window manager to shade `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_unshade ()

    void
    wnck_window_unshade (WnckWindow *window);

Asks the window manager to unshade `window` .

#### Parameters

window | a WnckWindow. |

### wnck_window_pin ()

    void
    wnck_window_pin (WnckWindow *window);

Asks the window manager to put `window` on all workspaces.

#### Parameters

window | a WnckWindow. |

### wnck_window_unpin ()

    void
    wnck_window_unpin (WnckWindow *window);

Asks the window manager to put `window` only in the currently active workspace, if `window` was previously pinned. If `window` was not pinned, does not change `window` 's workspace. If the active workspace is not known for some reason (it should not happen much), sets `window` 's workspace to the first workspace.

#### Parameters

window | a WnckWindow. |

### wnck_window_stick ()

    void
    wnck_window_stick (WnckWindow *window);

Asks the window manager to keep the `window` 's position fixed on the screen, even when the workspace or viewport scrolls.

#### Parameters

window | a WnckWindow. |

### wnck_window_unstick ()

    void
    wnck_window_unstick (WnckWindow *window);

Asks the window manager to not have `window` 's position fixed on the screen when the workspace or viewport scrolls.

#### Parameters

window | a WnckWindow. |

### wnck_window_make_above ()

    void
    wnck_window_make_above (WnckWindow *window);

Asks the window manager to put `window` on top of most windows (`window` will not be on top of focused fullscreen windows, of other windows with this setting and of dock windows).

#### Parameters

window | a WnckWindow. |

Since: 2.14

### wnck_window_unmake_above ()

    void
    wnck_window_unmake_above (WnckWindow *window);

Asks the window manager to not put `window` on top of most windows, and to put it again in the stack with other windows.

#### Parameters

window | a WnckWindow. |

Since: 2.14

### wnck_window_make_below ()

    void
    wnck_window_make_below (WnckWindow *window);

Asks the window manager to put `window` below most windows.

#### Parameters

window | a WnckWindow. |

Since: 2.20

### wnck_window_unmake_below ()

    void
    wnck_window_unmake_below (WnckWindow *window);

Asks the window manager to not put `window` below most windows, and to put it again in the stack with other windows.

#### Parameters

window | a WnckWindow. |

Since: 2.20

### wnck_window_set_skip_pager ()

    void
    wnck_window_set_skip_pager (WnckWindow *window,
                                gboolean skip);

Asks the window manager to make `window` included or not included on pagers.

#### Parameters

window | a WnckWindow. |
skip | whether `window` should be included on pagers. |

### wnck_window_set_skip_tasklist ()

    void
    wnck_window_set_skip_tasklist (WnckWindow *window,
                                   gboolean skip);

Asks the window manager to make `window` included or not included on tasklists.

#### Parameters

window | a WnckWindow. |
skip | whether `window` should be included on tasklists. |

### wnck_window_set_fullscreen ()

    void
    wnck_window_set_fullscreen (WnckWindow *window,
                                gboolean fullscreen);

Asks the window manager to set the fullscreen state of `window` according to `fullscreen` .

#### Parameters

window | a WnckWindow. |
fullscreen | whether to make `window` fullscreen. |

Since: 2.8

### wnck_window_close ()

    void
    wnck_window_close (WnckWindow *window,
                       guint32 timestamp);

Closes `window` .

This function existed before 2.6, but the `timestamp` argument was missing in earlier versions.

#### Parameters

window | a WnckWindow. |
timestamp | the X server timestamp of the user interaction event that caused this call to occur. |

Since: 2.6

### wnck_window_get_workspace ()

    WnckWorkspace *
    wnck_window_get_workspace (WnckWindow *window);

Gets the current workspace `window` is on. If the window is pinned (on all workspaces), or not on any workspaces, `NULL` may be returned.

#### Parameters

window | a WnckWindow. |

#### Returns

the single current workspace `window` is on, or `NULL`. The returned WnckWorkspace is owned by libwnck and must not be referenced or unreferenced.

[transfer none]

### wnck_window_is_on_workspace ()

    gboolean
    wnck_window_is_on_workspace (WnckWindow *window,
                                 WnckWorkspace *workspace);

Gets whether `window` appears on `workspace` .

#### Parameters

window | a WnckWindow. |
workspace | a WnckWorkspace. |

#### Returns

`TRUE` if `window` appears on `workspace` , `FALSE` otherwise.

### wnck_window_is_visible_on_workspace ()

    gboolean
    wnck_window_is_visible_on_workspace (WnckWindow *window,
                                         WnckWorkspace *workspace);

Like `wnck_window_is_on_workspace()`, but also checks that the window is in a visible state (i.e. not minimized or shaded).

#### Parameters

window | a WnckWindow. |
workspace | a WnckWorkspace. |

#### Returns

`TRUE` if `window` appears on `workspace` in normal state, `FALSE` otherwise.

### wnck_window_move_to_workspace ()

    void
    wnck_window_move_to_workspace (WnckWindow *window,
                                   WnckWorkspace *space);

Asks the window manager to move `window` to `space` . If `window` was pinned, it will also result in `window` being visible only on `space` .

#### Parameters

window | a WnckWindow. |
space | a WnckWorkspace. |

### wnck_window_is_in_viewport ()

    gboolean
    wnck_window_is_in_viewport (WnckWindow *window,
                                WnckWorkspace *workspace);

Gets `TRUE` if `window` appears in the current viewport of `workspace` .

#### Parameters

window | a WnckWindow. |
workspace | a WnckWorkspace. |

#### Returns

`TRUE` if `window` appears in current viewport of `workspace` , `FALSE` otherwise.

Since: 2.4

### wnck_window_activate ()

    void
    wnck_window_activate (WnckWindow *window,
                          guint32 timestamp);

Asks the window manager to make `window` the active window. The window manager may choose to raise `window` along with focusing it, and may decide to refuse the request (to not steal the focus if there is a more recent user activity, for example).

This function existed before 2.10, but the `timestamp` argument was missing in earlier versions.

#### Parameters

window | a WnckWindow. |
timestamp | the X server timestamp of the user interaction event that caused this call to occur. |

Since: 2.10

### wnck_window_is_active ()

    gboolean
    wnck_window_is_active (WnckWindow *window);

Gets whether `window` is the active window on its WnckScreen.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` is the active window on its WnckScreen, `FALSE` otherwise.

### wnck_window_is_most_recently_activated ()

    gboolean
    wnck_window_is_most_recently_activated
                                   (WnckWindow *window);

Gets whether `window` is the most recently activated window on its WnckScreen.

The most recently activated window is identical to the active window for click and sloppy focus methods (since a window is always active in those cases) but differs slightly for mouse focus since there often is no active window.

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if `window` was the most recently activated window on its WnckScreen, `FALSE` otherwise.

Since: 2.8

### wnck_window_activate_transient ()

    void
    wnck_window_activate_transient (WnckWindow *window,
                                    guint32 timestamp);

If `window` has transients, activates the most likely transient instead of the window itself. Otherwise activates `window` .

FIXME the ideal behavior of this function is probably to activate the most recently active window among `window` and its transients. This is probably best implemented on the window manager side.

This function existed before 2.10, but the `timestamp` argument was missing in earlier versions.

#### Parameters

window | a WnckWindow. |
timestamp | the X server timestamp of the user interaction event that caused this call to occur. |

Since: 2.10

### wnck_window_transient_is_most_recently_activated ()

    gboolean
    wnck_window_transient_is_most_recently_activated
                                   (WnckWindow *window);

Gets whether one of the transients of `window` is the most recently activated window. See `wnck_window_is_most_recently_activated()` for a more complete description of what is meant by most recently activated. This function is needed because clicking on a WnckTasklist once will activate a transient instead of `window` itself (wnck_window_activate_transient), and clicking again should minimize `window` and its transients. (Not doing this can be especially annoying in the case of modal dialogs that don't appear in the WnckTasklist).

#### Parameters

window | a WnckWindow. |

#### Returns

`TRUE` if one of the transients of `window` is the most recently activated window, `FALSE` otherwise.

Since: 2.12

### wnck_window_set_icon_geometry ()

    void
    wnck_window_set_icon_geometry (WnckWindow *window,
                                   int x,
                                   int y,
                                   int width,
                                   int height);

Sets the icon geometry for `window` . A typical use case for this is the destination of the minimization animation of `window` .

#### Parameters

window | a WnckWindow. |
x | X coordinate in pixels. |
y | Y coordinate in pixels. |
width | width in pixels. |
height | height in pixels. |

### wnck_window_get_client_window_geometry ()

    void
    wnck_window_get_client_window_geometry
                                   (WnckWindow *window,
                                    int *xp,
                                    int *yp,
                                    int *widthp,
                                    int *heightp);

Gets the size and position of `window` , as last received in a ConfigureNotify event (i.e. this call does not round-trip to the server, just gets the last size we were notified of). The X and Y coordinates are relative to the root window.

The window manager usually adds a frame around windows. If you need to know the size of `window` with the frame, use `wnck_window_get_geometry()`.

#### Parameters

window | a WnckWindow. |
xp | return location for X coordinate in pixels of `window` . | [out]
yp | return location for Y coordinate in pixels of `window` . | [out]
widthp | return location for width in pixels of `window` . | [out]
heightp | return location for height in pixels of `window` . | [out]

Since: 2.20

### wnck_window_get_geometry ()

    void
    wnck_window_get_geometry (WnckWindow *window,
                              int *xp,
                              int *yp,
                              int *widthp,
                              int *heightp);

Gets the size and position of `window` , including decorations. This function uses the information last received in a ConfigureNotify event and adjusts it according to the size of the frame that is added by the window manager (this call does not round-trip to the server, it just gets the last sizes that were notified). The X and Y coordinates are relative to the root window.

If you need to know the actual size of `window` ignoring the frame added by the window manager, use `wnck_window_get_client_window_geometry()`.

#### Parameters

window | a WnckWindow. |
xp | return location for X coordinate in pixels of `window` . | [out]
yp | return location for Y coordinate in pixels of `window` . | [out]
widthp | return location for width in pixels of `window` . | [out]
heightp | return location for height in pixels of `window` . | [out]

### wnck_window_set_geometry ()

    void
    wnck_window_set_geometry (WnckWindow *window,
                              WnckWindowGravity gravity,
                              WnckWindowMoveResizeMask geometry_mask,
                              int x,
                              int y,
                              int width,
                              int height);

Sets the size and position of `window` . The X and Y coordinates should be relative to the root window.

Note that the new size and position apply to `window` with its frame added by the window manager. Therefore, using `wnck_window_set_geometry()` with the values returned by `wnck_window_get_geometry()` should be a no-op, while using `wnck_window_set_geometry()` with the values returned by `wnck_window_get_client_window_geometry()` should reduce the size of `window` and move it.

#### Parameters

window | a WnckWindow. |
gravity | the gravity point to use as a reference for the new position. |
geometry_mask | a bitmask containing flags for what should be set. |
x | new X coordinate in pixels of `window` . |
y | new Y coordinate in pixels of `window` . |
width | new width in pixels of `window` . |
height | new height in pixels of `window` . |

Since: 2.16

### wnck_window_keyboard_move ()

    void
    wnck_window_keyboard_move (WnckWindow *window);

Asks the window manager to start moving `window` via the keyboard.

#### Parameters

window | a WnckWindow. |

### wnck_window_keyboard_size ()

    void
    wnck_window_keyboard_size (WnckWindow *window);

Asks the window manager to start resizing `window` via the keyboard.

#### Parameters

window | a WnckWindow. |

## Types and Values

### WnckWindow

    typedef struct _WnckWindow WnckWindow;

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

### enum WnckWindowType

Type describing the semantic type of a WnckWindow.

#### Members

WNCK_WINDOW_NORMAL | the window is a normal window. |
WNCK_WINDOW_DESKTOP | the window is a desktop. |
WNCK_WINDOW_DOCK | the window is a dock or a panel. |
WNCK_WINDOW_DIALOG | the window is a dialog window. |
WNCK_WINDOW_TOOLBAR | the window is a tearoff toolbar. |
WNCK_WINDOW_MENU | the window is a tearoff menu. |
WNCK_WINDOW_UTILITY | the window is a small persistent utility window, such as a palette or toolbox. |
WNCK_WINDOW_SPLASHSCREEN | the window is a splash screen displayed as an application is starting up. |

### enum WnckWindowState

Type used as a bitmask to describe the state of a WnckWindow.

#### Members

WNCK_WINDOW_STATE_MINIMIZED | the window is minimized. |
WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY | the window is horizontically maximized. |
WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY | the window is vertically maximized. |
WNCK_WINDOW_STATE_SHADED | the window is shaded. |
WNCK_WINDOW_STATE_SKIP_PAGER | the window should not be included on pagers. |
WNCK_WINDOW_STATE_SKIP_TASKLIST | the window should not be included on tasklists. |
WNCK_WINDOW_STATE_STICKY | the window is sticky (see `wnck_window_is_sticky()`). |
WNCK_WINDOW_STATE_HIDDEN | the window is not visible on its WnckWorkspace and viewport (when minimized, for example). |
WNCK_WINDOW_STATE_FULLSCREEN | the window is fullscreen. |
WNCK_WINDOW_STATE_DEMANDS_ATTENTION | the window needs attention (because the window requested activation but the window manager refused it, for example). |
WNCK_WINDOW_STATE_URGENT | the window requires a response from the user. |
WNCK_WINDOW_STATE_ABOVE | the window is above other windows (see `wnck_window_make_above()`). |
WNCK_WINDOW_STATE_BELOW | the window is below other windows (see `wnck_window_make_below()`). |

### enum WnckWindowActions

Type used as a bitmask to describe the actions that can be done for a WnckWindow.

#### Members

WNCK_WINDOW_ACTION_MOVE | the window may be moved around the screen. |
WNCK_WINDOW_ACTION_RESIZE | the window may be resized. |
WNCK_WINDOW_ACTION_SHADE | the window may be shaded. |
WNCK_WINDOW_ACTION_STICK | the window may be sticked. |
WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY | the window may be maximized horizontally. |
WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY | the window may be maximized vertically. |
WNCK_WINDOW_ACTION_CHANGE_WORKSPACE | the window may be moved between workspaces, or (un)pinned. |
WNCK_WINDOW_ACTION_CLOSE | the window may be closed. |
WNCK_WINDOW_ACTION_UNMAXIMIZE_HORIZONTALLY | the window may be unmaximized horizontally. |
WNCK_WINDOW_ACTION_UNMAXIMIZE_VERTICALLY | the window may be maximized vertically. |
WNCK_WINDOW_ACTION_UNSHADE | the window may be unshaded. |
WNCK_WINDOW_ACTION_UNSTICK | the window may be unsticked. |
WNCK_WINDOW_ACTION_MINIMIZE | the window may be minimized. |
WNCK_WINDOW_ACTION_UNMINIMIZE | the window may be unminimized. |
WNCK_WINDOW_ACTION_MAXIMIZE | the window may be maximized. |
WNCK_WINDOW_ACTION_UNMAXIMIZE | the window may be unmaximized. |
WNCK_WINDOW_ACTION_FULLSCREEN | the window may be brought to fullscreen. |
WNCK_WINDOW_ACTION_ABOVE | the window may be made above other windows. |
WNCK_WINDOW_ACTION_BELOW | the window may be made below other windows. |

### enum WnckWindowGravity

Flag used when changing the geometry of a WnckWindow. This is the gravity point to use as a reference for the new position.

#### Members

WNCK_WINDOW_GRAVITY_CURRENT | keep the current gravity point. |
WNCK_WINDOW_GRAVITY_NORTHWEST | use the left top corner of the frame window as gravity point. |
WNCK_WINDOW_GRAVITY_NORTH | use the center of the frame window's top side as gravity point. |
WNCK_WINDOW_GRAVITY_NORTHEAST | use the right top corner of the frame window as gravity point. |
WNCK_WINDOW_GRAVITY_WEST | use the center of the frame window's left side as gravity point. |
WNCK_WINDOW_GRAVITY_CENTER | use the center of the frame window as gravity point. |
WNCK_WINDOW_GRAVITY_EAST | use the center of the frame window's right side as gravity point. |
WNCK_WINDOW_GRAVITY_SOUTHWEST | use the left bottom corner of the frame window as gravity point. |
WNCK_WINDOW_GRAVITY_SOUTH | use the center of the frame window's bottom side as gravity point. |
WNCK_WINDOW_GRAVITY_SOUTHEAST | use the right bottom corner of the frame window as gravity point. |
WNCK_WINDOW_GRAVITY_STATIC | use the left top corner of the client window as gravity point. |

Since: 2.16

### enum WnckWindowMoveResizeMask

Flag used as a bitmask when changing the geometry of a WnckWindow. This indicates which part of the geometry should be changed.

#### Members

WNCK_WINDOW_CHANGE_X | X coordinate of the window should be changed. |
WNCK_WINDOW_CHANGE_Y | Y coordinate of the window should be changed. |
WNCK_WINDOW_CHANGE_WIDTH | width of the window should be changed. |
WNCK_WINDOW_CHANGE_HEIGHT | height of the window should be changed. |

Since: 2.16

## Signal Details

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

    void
    user_function (WnckWindow       *window,
                   WnckWindowActions changed_mask,
                   WnckWindowActions new_state,
                   gpointer          user_data)

Emitted when the actions availabilities for `window` change.

#### Parameters

window | the WnckWindow which emitted the signal. |
changed_mask | the bitmask containing bits set for all actions availabilities for `window` that have changed. |
new_state | the new actions availabilities for `window` . |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

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

    void
    user_function (WnckWindow *window,
                   gpointer    user_data)

Emitted when the class name or instance name of `window` changes.

#### Parameters

window | the WnckWindow which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

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

    void
    user_function (WnckWindow *window,
                   gpointer    user_data)

Emitted when the geometry of `window` changes.

#### Parameters

window | the WnckWindow which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

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

    void
    user_function (WnckWindow *window,
                   gpointer    user_data)

Emitted when the icon of `window` changes.

#### Parameters

window | the WnckWindow 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 (WnckWindow *window,
                   gpointer    user_data)

Emitted when the name of `window` changes.

#### Parameters

window | the WnckWindow which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

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

    void
    user_function (WnckWindow *window,
                   gpointer    user_data)

Emitted when the role of `window` changes.

#### Parameters

window | the WnckWindow which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

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

    void
    user_function (WnckWindow     *window,
                   WnckWindowState changed_mask,
                   WnckWindowState new_state,
                   gpointer        user_data)

Emitted when the state of `window` changes. This can happen when `window` is (un)minimized, (un)maximized, (un)sticked, (un)shaded, (un)made above, (un)made below, (un)set fullscreen, when it needs attention, etc. See WnckWindowState for the complete list of states that might have changed.

#### Parameters

window | the WnckWindow which emitted the signal. |
changed_mask | the bitmask containing bits set for all states of `window` that have changed. |
new_state | the new state of `window` . |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

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

    void
    user_function (WnckWindow *window,
                   gpointer    user_data)

Emitted when the EWMH type hint of the window changes.

#### Parameters

window | the WnckWindow which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.20

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

    void
    user_function (WnckWindow *window,
                   gpointer    user_data)

Emitted when the current workspace of `window` changes, or if `window` has been pinned or unpinned.

#### Parameters

window | the WnckWindow which emitted the signal. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

## See Also

WnckWorkspace, WnckApplication, WnckClassGroup