## WnckWindow

WnckWindow —

## Synopsis

    enum        WnckWindowState;
    enum        WnckWindowActions;
    enum        WnckWindowType;
    struct      WnckWindowPrivate;
    WnckWindow* wnck_window_get                 (gulong xwindow);
    WnckScreen* wnck_window_get_screen          (WnckWindow *window);
    const char* wnck_window_get_name            (WnckWindow *window);
    const char* wnck_window_get_icon_name       (WnckWindow *window);
    WnckApplication* wnck_window_get_application
                                                (WnckWindow *window);
    gulong      wnck_window_get_group_leader    (WnckWindow *window);
    gulong      wnck_window_get_xid             (WnckWindow *window);
    WnckClassGroup* wnck_window_get_class_group (WnckWindow *window);
    const char* wnck_window_get_session_id      (WnckWindow *window);
    const char* wnck_window_get_session_id_utf8 (WnckWindow *window);
    int         wnck_window_get_pid             (WnckWindow *window);
    WnckWindowType wnck_window_get_window_type  (WnckWindow *window);
    gboolean    wnck_window_is_minimized        (WnckWindow *window);
    gboolean    wnck_window_is_maximized_horizontally
                                                (WnckWindow *window);
    gboolean    wnck_window_is_maximized_vertically
                                                (WnckWindow *window);
    gboolean    wnck_window_is_maximized        (WnckWindow *window);
    gboolean    wnck_window_is_shaded           (WnckWindow *window);
    gboolean    wnck_window_is_skip_pager       (WnckWindow *window);
    gboolean    wnck_window_is_skip_tasklist    (WnckWindow *window);
    gboolean    wnck_window_is_sticky           (WnckWindow *window);
    gboolean    wnck_window_demands_attention   (WnckWindow *window);
    void        wnck_window_set_skip_pager      (WnckWindow *window,
                                                 gboolean skip);
    void        wnck_window_set_skip_tasklist   (WnckWindow *window,
                                                 gboolean skip);
    void        wnck_window_close               (WnckWindow *window,
                                                 guint32 timestamp);
    void        wnck_window_minimize            (WnckWindow *window);
    void        wnck_window_unminimize          (WnckWindow *window);
    void        wnck_window_maximize            (WnckWindow *window);
    void        wnck_window_unmaximize          (WnckWindow *window);
    void        wnck_window_maximize_horizontally
                                                (WnckWindow *window);
    void        wnck_window_unmaximize_horizontally
                                                (WnckWindow *window);
    void        wnck_window_maximize_vertically (WnckWindow *window);
    void        wnck_window_unmaximize_vertically
                                                (WnckWindow *window);
    void        wnck_window_shade               (WnckWindow *window);
    void        wnck_window_unshade             (WnckWindow *window);
    void        wnck_window_stick               (WnckWindow *window);
    void        wnck_window_unstick             (WnckWindow *window);
    void        wnck_window_keyboard_move       (WnckWindow *window);
    void        wnck_window_keyboard_size       (WnckWindow *window);
    WnckWorkspace* wnck_window_get_workspace    (WnckWindow *window);
    void        wnck_window_move_to_workspace   (WnckWindow *window,
                                                 WnckWorkspace *space);
    gboolean    wnck_window_is_pinned           (WnckWindow *window);
    void        wnck_window_pin                 (WnckWindow *window);
    void        wnck_window_unpin               (WnckWindow *window);
    void        wnck_window_activate            (WnckWindow *window);
    gboolean    wnck_window_is_active           (WnckWindow *window);
    gboolean    wnck_window_is_most_recently_activated
                                                (WnckWindow *window);
    void        wnck_window_activate_transient  (WnckWindow *window);
    GdkPixbuf*  wnck_window_get_icon            (WnckWindow *window);
    GdkPixbuf*  wnck_window_get_mini_icon       (WnckWindow *window);
    gboolean    wnck_window_get_icon_is_fallback
                                                (WnckWindow *window);
    void        wnck_window_set_icon_geometry   (WnckWindow *window,
                                                 int x,
                                                 int y,
                                                 int width,
                                                 int height);
    WnckWindowActions wnck_window_get_actions   (WnckWindow *window);
    WnckWindowState wnck_window_get_state       (WnckWindow *window);
    void        wnck_window_get_geometry        (WnckWindow *window,
                                                 int *xp,
                                                 int *yp,
                                                 int *widthp,
                                                 int *heightp);
    gboolean    wnck_window_is_visible_on_workspace
                                                (WnckWindow *window,
                                                 WnckWorkspace *workspace);
    gboolean    wnck_window_is_on_workspace     (WnckWindow *window,
                                                 WnckWorkspace *workspace);
    gboolean    wnck_window_is_in_viewport      (WnckWindow *window,
                                                 WnckWorkspace *workspace);

## Description

## Details

### enum WnckWindowState

    typedef enum
    {
      WNCK_WINDOW_STATE_MINIMIZED              = 1 << 0,
      WNCK_WINDOW_STATE_MAXIMIZED_HORIZONTALLY = 1 << 1,
      WNCK_WINDOW_STATE_MAXIMIZED_VERTICALLY   = 1 << 2,
      WNCK_WINDOW_STATE_SHADED                 = 1 << 3,
      WNCK_WINDOW_STATE_SKIP_PAGER             = 1 << 4,
      WNCK_WINDOW_STATE_SKIP_TASKLIST          = 1 << 5,
      WNCK_WINDOW_STATE_STICKY                 = 1 << 6,
      WNCK_WINDOW_STATE_HIDDEN                 = 1 << 7,
      WNCK_WINDOW_STATE_FULLSCREEN             = 1 << 8,
      WNCK_WINDOW_STATE_DEMANDS_ATTENTION      = 1 << 9
    } WnckWindowState;

### enum WnckWindowActions

    typedef enum
    {
      WNCK_WINDOW_ACTION_MOVE                    = 1 << 0,
      WNCK_WINDOW_ACTION_RESIZE                  = 1 << 1,
      WNCK_WINDOW_ACTION_SHADE                   = 1 << 2,
      WNCK_WINDOW_ACTION_STICK                   = 1 << 3,
      WNCK_WINDOW_ACTION_MAXIMIZE_HORIZONTALLY   = 1 << 4,
      WNCK_WINDOW_ACTION_MAXIMIZE_VERTICALLY     = 1 << 5,
      WNCK_WINDOW_ACTION_CHANGE_WORKSPACE        = 1 << 6, /* includes pin/unpin */
      WNCK_WINDOW_ACTION_CLOSE                   = 1 << 7,
      WNCK_WINDOW_ACTION_UNMAXIMIZE_HORIZONTALLY = 1 << 8,
      WNCK_WINDOW_ACTION_UNMAXIMIZE_VERTICALLY   = 1 << 9,
      WNCK_WINDOW_ACTION_UNSHADE                 = 1 << 10,
      WNCK_WINDOW_ACTION_UNSTICK                 = 1 << 11,
      WNCK_WINDOW_ACTION_MINIMIZE                = 1 << 12,
      WNCK_WINDOW_ACTION_UNMINIMIZE              = 1 << 13,
      WNCK_WINDOW_ACTION_MAXIMIZE                = 1 << 14,
      WNCK_WINDOW_ACTION_UNMAXIMIZE              = 1 << 15
    } WnckWindowActions;

### enum WnckWindowType

    typedef enum
    {
      WNCK_WINDOW_NORMAL,       /* document/app window */
      WNCK_WINDOW_DESKTOP,      /* desktop background */
      WNCK_WINDOW_DOCK,         /* panel */
      WNCK_WINDOW_DIALOG,       /* dialog */
      WNCK_WINDOW_MODAL_DIALOG, /* modal dialog */
      WNCK_WINDOW_TOOLBAR,      /* tearoff toolbar */
      WNCK_WINDOW_MENU,         /* tearoff menu */
      WNCK_WINDOW_UTILITY,      /* palette/toolbox window */
      WNCK_WINDOW_SPLASHSCREEN  /* splash screen */
    } WnckWindowType;

### struct WnckWindowPrivate

    struct WnckWindowPrivate;

### wnck_window_get ()

    WnckWindow* wnck_window_get                 (gulong xwindow);

Gets a preexisting WnckWindow for the X window `xwindow`. Will not create a WnckWindow if none exists. Robust against bogus window IDs.

`xwindow` : | an Xlib window ID
Returns : | the WnckWindow for this X window

### wnck_window_get_screen ()

    WnckScreen* wnck_window_get_screen          (WnckWindow *window);

Gets the screen this window is on.

`window` : | a WnckWindow
Returns : | a WnckScreen

### wnck_window_get_name ()

    const char* wnck_window_get_name            (WnckWindow *window);

Gets the name of the window, as it should be displayed in a pager or tasklist. Always returns some value, even if the window hasn't set a name.

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

`window` : | a WnckWindow
Returns : | name of the window

### wnck_window_get_icon_name ()

    const char* wnck_window_get_icon_name       (WnckWindow *window);

Gets the name of the window, as it should be displayed for an icon. Always returns some value, even if the window hasn't set a name. Contrast with `wnck_window_get_name()`, which returns the window title, not the icon title.

`window` : | a WnckWindow
Returns : | name of the window

### wnck_window_get_application ()

    WnckApplication* wnck_window_get_application
                                                (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_get_group_leader ()

    gulong      wnck_window_get_group_leader    (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_get_xid ()

    gulong      wnck_window_get_xid             (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_get_class_group ()

    WnckClassGroup* wnck_window_get_class_group (WnckWindow *window);

`window` : |
Returns : |

### 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()`.

`window` : | a WnckWindow
Returns : | session ID in Latin-1

### wnck_window_get_session_id_utf8 ()

    const char* wnck_window_get_session_id_utf8 (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_get_pid ()

    int         wnck_window_get_pid             (WnckWindow *window);

Gets the process ID of `window`, if available.

`window` : | a WnckWindow
Returns : | PID of `window`, or 0 if none available

### wnck_window_get_window_type ()

    WnckWindowType wnck_window_get_window_type  (WnckWindow *window);

Retrieves the semantic type of the window.

`window` : | a WnckWindow
Returns : | semantic type

### wnck_window_is_minimized ()

    gboolean    wnck_window_is_minimized        (WnckWindow *window);

If the window is minimized returns `TRUE`. Minimization state may change anytime a state_changed signal gets emitted.

`window` : | a WnckWindow
Returns : | `TRUE` if window is minimized

### wnck_window_is_maximized_horizontally ()

    gboolean    wnck_window_is_maximized_horizontally
                                                (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_is_maximized_vertically ()

    gboolean    wnck_window_is_maximized_vertically
                                                (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_is_maximized ()

    gboolean    wnck_window_is_maximized        (WnckWindow *window);

As for GDK, "maximized" means both vertically and horizontally. If only one, then the window isn't considered maximized.

`window` : | a WnckWindow
Returns : | `TRUE` if the window is maximized in both directions

### wnck_window_is_shaded ()

    gboolean    wnck_window_is_shaded           (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_is_skip_pager ()

    gboolean    wnck_window_is_skip_pager       (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_is_skip_tasklist ()

    gboolean    wnck_window_is_skip_tasklist    (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_is_sticky ()

    gboolean    wnck_window_is_sticky           (WnckWindow *window);

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.

`window` : | a WnckWindow
Returns : | `TRUE` if the window is "stuck to the glass"

### wnck_window_demands_attention ()

    gboolean    wnck_window_demands_attention   (WnckWindow *window);

If the window is has the demands attention state set returns `TRUE`. This state may change anytime a state_changed signal gets emitted.

`window` : | a WnckWindow
Returns : | `TRUE` if window is minimized

### wnck_window_set_skip_pager ()

    void        wnck_window_set_skip_pager      (WnckWindow *window,
                                                 gboolean skip);

`window` : |
`skip` : |

### wnck_window_set_skip_tasklist ()

    void        wnck_window_set_skip_tasklist   (WnckWindow *window,
                                                 gboolean skip);

`window` : |
`skip` : |

### wnck_window_close ()

    void        wnck_window_close               (WnckWindow *window,
                                                 guint32 timestamp);

`window` : |
`timestamp` : |

### wnck_window_minimize ()

    void        wnck_window_minimize            (WnckWindow *window);

`window` : |

### wnck_window_unminimize ()

    void        wnck_window_unminimize          (WnckWindow *window);

`window` : |

### wnck_window_maximize ()

    void        wnck_window_maximize            (WnckWindow *window);

`window` : |

### wnck_window_unmaximize ()

    void        wnck_window_unmaximize          (WnckWindow *window);

`window` : |

### wnck_window_maximize_horizontally ()

    void        wnck_window_maximize_horizontally
                                                (WnckWindow *window);

`window` : |

### wnck_window_unmaximize_horizontally ()

    void        wnck_window_unmaximize_horizontally
                                                (WnckWindow *window);

`window` : |

### wnck_window_maximize_vertically ()

    void        wnck_window_maximize_vertically (WnckWindow *window);

`window` : |

### wnck_window_unmaximize_vertically ()

    void        wnck_window_unmaximize_vertically
                                                (WnckWindow *window);

`window` : |

### wnck_window_shade ()

    void        wnck_window_shade               (WnckWindow *window);

`window` : |

### wnck_window_unshade ()

    void        wnck_window_unshade             (WnckWindow *window);

`window` : |

### wnck_window_stick ()

    void        wnck_window_stick               (WnckWindow *window);

`window` : |

### wnck_window_unstick ()

    void        wnck_window_unstick             (WnckWindow *window);

`window` : |

### wnck_window_keyboard_move ()

    void        wnck_window_keyboard_move       (WnckWindow *window);

`window` : |

### wnck_window_keyboard_size ()

    void        wnck_window_keyboard_size       (WnckWindow *window);

`window` : |

### wnck_window_get_workspace ()

    WnckWorkspace* wnck_window_get_workspace    (WnckWindow *window);

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

`window` : | a WnckWindow
Returns : | single current workspace or `NULL`

### wnck_window_move_to_workspace ()

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

`window` : |
`space` : |

### wnck_window_is_pinned ()

    gboolean    wnck_window_is_pinned           (WnckWindow *window);

`TRUE` if the window is on all workspaces. Note that if this changes, it's signalled by a workspace_changed signal, not state_changed.

`window` : | a WnckWindow
Returns : | `TRUE` if on all workspaces

### wnck_window_pin ()

    void        wnck_window_pin                 (WnckWindow *window);

`window` : |

### wnck_window_unpin ()

    void        wnck_window_unpin               (WnckWindow *window);

Sets `window`'s workspace to only the currently active workspace, if the window was previously pinned. If the window wasn't pinned, doesn't change the window's workspace. If the active workspace isn't known for some reason (shouldn't happen much), sets the window's workspace to 0.

`window` : | a WnckWindow

### wnck_window_activate ()

    void        wnck_window_activate            (WnckWindow *window);

Ask the window manager to make `window` the active window. The window manager may choose to raise `window` along with focusing it.

`window` : | a WnckWindow

### wnck_window_is_active ()

    gboolean    wnck_window_is_active           (WnckWindow *window);

`window` : | a WnckWindow
Returns : | `TRUE` if the window is the active window

### wnck_window_is_most_recently_activated ()

    gboolean    wnck_window_is_most_recently_activated
                                                (WnckWindow *window);

Determines whether `window` is the most recently activated window. 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 we often have no window active.

`window` : | a WnckWindow
Returns : | `TRUE` if window was the most recently activated window

### wnck_window_activate_transient ()

    void        wnck_window_activate_transient  (WnckWindow *window);

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.

`window` : | a WnckWindow

### wnck_window_get_icon ()

    GdkPixbuf*  wnck_window_get_icon            (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_get_mini_icon ()

    GdkPixbuf*  wnck_window_get_mini_icon       (WnckWindow *window);

`window` : |
Returns : |

### wnck_window_get_icon_is_fallback ()

    gboolean    wnck_window_get_icon_is_fallback
                                                (WnckWindow *window);

Checks if we are using a default fallback icon because none was set on the window.

`window` : | a WnckWindow
Returns : | `TRUE` if icon is a fallback

### wnck_window_set_icon_geometry ()

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

Set the icon geometry for a WnckWindow.

`window` : | a WnckWindow
`x` : | x coordinate in pixels
`y` : | y coordinate in pixels
`width` : | width in pixels
`height` : | height in pixels

### wnck_window_get_actions ()

    WnckWindowActions wnck_window_get_actions   (WnckWindow *window);

Gets the window operations that should be sensitive for `window`.

`window` : | a WnckWindow
Returns : | bitmask of actions the window supports

### wnck_window_get_state ()

    WnckWindowState wnck_window_get_state       (WnckWindow *window);

Gets the state of a window as a bitmask.

`window` : | a WnckWindow
Returns : | bitmask of active state flags.

### 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 the window, as last received in a configure notify (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.

`window` : | a WnckWindow
`xp` : | return location for X coordinate of window
`yp` : | return location for Y coordinate of window
`widthp` : | return location for width of window
`heightp` : | return location for height of window

### 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).

`window` : | a WnckWindow
`workspace` : | a WnckWorkspace
Returns : | `TRUE` if `window` appears on `workspace` in normal state

### wnck_window_is_on_workspace ()

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

`window` : | a WnckWindow
`workspace` : | a WnckWorkspace
Returns : | `TRUE` if `window` appears on `workspace`

### wnck_window_is_in_viewport ()

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

Returns TRUE if the window is inside the current viewport of the given workspace.

`window` : | a WnckWindow
`workspace` : | a WnckWorkspace
Returns : | `TRUE` if `window` appears in current viewport