Class: Wnck::Window

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get(xwindow) ⇒ Wnck::Window

Gets a preexisting Wnck::Window for the X window xwindow. This will not create a Wnck::Window if none exists. The function is robust against bogus window IDs. Wnck::Window is owned by libwnck and must not be referenced or unreferenced.

Parameters:

  • xwindow (Wnck::gulong)

    an X window ID.

Returns:

  • (Wnck::Window)

    the Wnck::Window for xwindow. The returned

Instance Method Details

#actionsWnck::WindowActions

Gets the actions that can be done for window.

Returns:

#activate(timestamp) ⇒ nil

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. this call to occur.

Parameters:

  • timestamp (Integer)

    the X server timestamp of the user interaction event that caused

Returns:

  • (nil)

#activate_transient(timestamp) ⇒ nil

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. this call to occur.

Parameters:

  • timestamp (Integer)

    the X server timestamp of the user interaction event that caused

Returns:

  • (nil)

#applicationWnck::Application

Gets the Wnck::Application to which window belongs. The returned Wnck::Application is owned by libwnck and must not be referenced or unreferenced.

Returns:

#class_groupWnck::ClassGroup

Gets the Wnck::ClassGroup to which window belongs. The returned Wnck::ClassGroup is owned by libwnck and must not be referenced or unreferenced.

Returns:

#class_group_nameString

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

The class group name is also the identifier name of the Wnck::ClassGroup to which window belongs. to no class group.

Returns:

  • (String)

    the class group name for window, or nil if window belongs

#class_instance_nameString

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. no class instance.

Returns:

  • (String)

    the class instance name for window, or nil if window has

#close(timestamp) ⇒ nil

Closes window.

This function existed before 2.6, but the timestamp argument was missing in earlier versions. this call to occur.

Parameters:

  • timestamp (Integer)

    the X server timestamp of the user interaction event that caused

Returns:

  • (nil)

#fullscreen=(fullscreen) ⇒ nil

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

Parameters:

  • fullscreen (Boolean)

    whether to make window fullscreen.

Returns:

  • (nil)

#get_client_window_geometry(xp, yp, widthp, heightp) ⇒ nil

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:

  • xp (Integer)

    return location for X coordinate in pixels of window.

  • yp (Integer)

    return location for Y coordinate in pixels of window.

  • widthp (Integer)

    return location for width in pixels of window.

  • heightp (Integer)

    return location for height in pixels of window.

Returns:

  • (nil)

#get_geometry(xp, yp, widthp, heightp) ⇒ nil

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:

  • xp (Integer)

    return location for X coordinate in pixels of window.

  • yp (Integer)

    return location for Y coordinate in pixels of window.

  • widthp (Integer)

    return location for width in pixels of window.

  • heightp (Integer)

    return location for height in pixels of window.

Returns:

  • (nil)

#group_leaderWnck::gulong

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

Returns:

  • (Wnck::gulong)

    the group leader of the group of windows to which window

#has_icon_nameBoolean

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.) window's icon name, false if it returns a fallback name.

Returns:

  • (Boolean)

    true if wnck_window_get_icon_name() returns

#has_nameBoolean

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. name, false if it returns a fallback name.

Returns:

  • (Boolean)

    true if wnck_window_get_name() returns window's

#iconGdkPixbuf::Pixbuf

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. reference the returned GdkPixbuf if it needs to keep the icon around.

Returns:

  • (GdkPixbuf::Pixbuf)

    the icon for window. The caller should

#icon_is_fallbackBoolean

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

Returns:

  • (Boolean)

    true if the icon for window is a fallback, false otherwise.

#icon_nameString

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. name is available.

Returns:

  • (String)

    the icon name of window, or a fallback icon name if no icon

#is_aboveBoolean

Gets whether window is above other windows. This state may change anytime a Wnck::Window::state-changed signal gets emitted.

See wnck_window_make_above() for more details on this state.

Returns:

  • (Boolean)

    true if window is above other windows, false otherwise.

#is_activeBoolean

Gets whether window is the active window on its Wnck::Screen. false otherwise.

Returns:

  • (Boolean)

    true if window is the active window on its Wnck::Screen,

#is_belowBoolean

Gets whether window is below other windows. This state may change anytime a Wnck::Window::state-changed signal gets emitted.

See wnck_window_make_below() for more details on this state.

Returns:

  • (Boolean)

    true if window is below other windows, false otherwise.

#is_fullscreenBoolean

Gets whether window is fullscreen. Fullscreen state may change anytime a Wnck::Window::state-changed signal gets emitted.

Returns:

  • (Boolean)

    true if window is fullscreen, false otherwise.

#is_in_viewport(workspace) ⇒ Boolean

Gets true if window appears in the current viewport of workspace. false otherwise.

Parameters:

Returns:

  • (Boolean)

    true if window appears in current viewport of workspace,

#is_maximizedBoolean

Gets whether window is maximized. Maximization state may change anytime a Wnck::Window::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. otherwise.

Returns:

  • (Boolean)

    true if window is maximized in both directions, false

#is_maximized_horizontallyBoolean

Gets whether window is maximized horizontally. Horizontal maximization state may change anytime a Wnck::Window::state-changed signal gets emitted.

Returns:

  • (Boolean)

    true if window is maximized horizontally, false otherwise.

#is_maximized_verticallyBoolean

Gets whether window is maximized vertically. vertiVal maximization state may change anytime a Wnck::Window::state-changed signal gets emitted.

Returns:

  • (Boolean)

    true if window is maximized vertically, false otherwise.

#is_minimizedBoolean

Gets whether window is minimized. Minimization state may change anytime a Wnck::Window::state-changed signal gets emitted.

Returns:

  • (Boolean)

    true if window is minimized, false otherwise.

#is_most_recently_activatedBoolean

Gets whether window is the most recently activated window on its Wnck::Screen.

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. Wnck::Screen, false otherwise.

Returns:

  • (Boolean)

    true if window was the most recently activated window on its

#is_on_workspace(workspace) ⇒ Boolean

Gets whether window appears on workspace.

Parameters:

Returns:

  • (Boolean)

    true if window appears on workspace, false otherwise.

#is_pinnedBoolean

Gets whether window is on all workspace. Pinned state may change anytime a Wnck::Window::workspace-changed signal gets emitted, but not when a Wnck::Window::state-changed gets emitted.

Returns:

  • (Boolean)

    true if window is on all workspaces, false otherwise.

#is_shadedBoolean

Gets whether window is shaded. Shade state may change anytime a Wnck::Window::state-changed signal gets emitted.

Returns:

  • (Boolean)

    true if window is shaded, false otherwise.

#is_skip_pagerBoolean

Gets whether window is included on pagers. This state may change anytime a Wnck::Window::state-changed signal gets emitted.

Returns:

  • (Boolean)

    true if window is included on pagers, false otherwise.

#is_skip_tasklistBoolean

Gets whether window is included on tasklists. This state may change anytime a Wnck::Window::state-changed signal gets emitted.

Returns:

  • (Boolean)

    true if window is included on tasklists, false otherwise.

#is_stickyBoolean

Gets whether window is sticky. Sticky state may change anytime a Wnck::Window::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.

Returns:

  • (Boolean)

    true if window is "stuck to the glass", false otherwise.

#is_visible_on_workspace(workspace) ⇒ Boolean

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

Parameters:

Returns:

  • (Boolean)

    true if window appears on workspace in normal state, false

#keyboard_movenil

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

Returns:

  • (nil)

#keyboard_sizenil

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

Returns:

  • (nil)

#make_abovenil

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

Returns:

  • (nil)

#make_belownil

Asks the window manager to put window below most windows.

Returns:

  • (nil)

#maximizenil

Asks the window manager to maximize window.

Returns:

  • (nil)

#maximize_horizontallynil

Asks the window manager to maximize horizontally window.

Returns:

  • (nil)

#maximize_verticallynil

Asks the window manager to maximize vertically window.

Returns:

  • (nil)

#mini_iconGdkPixbuf::Pixbuf

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. reference the returned GdkPixbuf if it needs to keep the icon around.

Returns:

  • (GdkPixbuf::Pixbuf)

    the mini-icon for window. The caller should

#minimizenil

Minimizes window.

Returns:

  • (nil)

#move_to_workspace(space) ⇒ nil

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:

Returns:

  • (nil)

#nameString

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. available.

Returns:

  • (String)

    the name of window, or a fallback name if no name is

#needs_attentionBoolean

Gets whether window needs attention. This state may change anytime a Wnck::Window::state-changed signal gets emitted.

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

Returns:

  • (Boolean)

    true if window needs attention, false otherwise.

#or_transient_needs_attentionBoolean

Gets whether window or one of its transients needs attention. This state may change anytime a Wnck::Window::state-changed signal gets emitted. false otherwise.

Returns:

  • (Boolean)

    true if window or one of its transients needs attention,

#pidInteger

Gets the process ID of window.

Returns:

  • (Integer)

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

#pinnil

Asks the window manager to put window on all workspaces.

Returns:

  • (nil)

#roleString

Gets the role for window. The role uniquely identifies a window among all windows that have the same client leader window.

Returns:

  • (String)

    role for window, or nil if window has no role.

#screenWnck::Screen

Gets the Wnck::Screen window is on. Wnck::Screen is owned by libwnck and must not be referenced or unreferenced.

Returns:

  • (Wnck::Screen)

    the Wnck::Screen window is on. The returned

#session_idString

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(). no session ID.

Returns:

  • (String)

    the session ID for window in Latin-1, or nil if window has

#session_id_utf8String

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. no session ID.

Returns:

  • (String)

    the session ID for window in UTF-8, or nil if window has

#set_geometry(gravity, geometry_mask, x, y, width, height) ⇒ nil

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:

  • gravity (Wnck::WindowGravity)

    the gravity point to use as a reference for the new position.

  • geometry_mask (Wnck::WindowMoveResizeMask)

    a bitmask containing flags for what should be set.

  • x (Integer)

    new X coordinate in pixels of window.

  • y (Integer)

    new Y coordinate in pixels of window.

  • width (Integer)

    new width in pixels of window.

  • height (Integer)

    new height in pixels of window.

Returns:

  • (nil)

#set_icon_geometry(x, y, width, height) ⇒ nil

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

Parameters:

  • x (Integer)

    X coordinate in pixels.

  • y (Integer)

    Y coordinate in pixels.

  • width (Integer)

    width in pixels.

  • height (Integer)

    height in pixels.

Returns:

  • (nil)

#shadenil

Asks the window manager to shade window.

Returns:

  • (nil)

#skip_pager=(skip) ⇒ nil

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

Parameters:

  • skip (Boolean)

    whether window should be included on pagers.

Returns:

  • (nil)

#skip_tasklist=(skip) ⇒ nil

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

Parameters:

  • skip (Boolean)

    whether window should be included on tasklists.

Returns:

  • (nil)

#sort_orderInteger

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

Returns:

  • (Integer)

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

#sort_order=(order) ⇒ nil

Sets the sort order of window. The sort order is used for ordering of window in Wnck::Selector and #WnckTasklist.

Parameters:

  • order (Integer)

    new sort order for window.

Returns:

  • (nil)

#stateWnck::WindowState

Gets the state of window.

Returns:

#sticknil

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

Returns:

  • (nil)

#transientWnck::Window

Gets the Wnck::Window for which window is transient. transient, or nil if window is not transient for any Wnck::Window. The returned Wnck::Window is owned by libwnck and must not be referenced or unreferenced.

Returns:

#transient_is_most_recently_activatedBoolean

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 Wnck::Tasklist 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 Wnck::Tasklist). activated window, false otherwise.

Returns:

  • (Boolean)

    true if one of the transients of window is the most recently

#unmake_abovenil

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

Returns:

  • (nil)

#unmake_belownil

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

Returns:

  • (nil)

#unmaximizenil

Asks the window manager to unmaximize window.

Returns:

  • (nil)

#unmaximize_horizontallynil

Asks the window manager to unmaximize horizontally window.

Returns:

  • (nil)

#unmaximize_verticallynil

Asks the window manager to unmaximize vertically window.

Returns:

  • (nil)

#unminimize(timestamp) ⇒ nil

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

Parameters:

  • timestamp (Integer)

    the X server timestamp of the user interaction event that caused

Returns:

  • (nil)

#unpinnil

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.

Returns:

  • (nil)

#unshadenil

Asks the window manager to unshade window.

Returns:

  • (nil)

#unsticknil

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

Returns:

  • (nil)

#window_typeWnck::WindowType

Gets the semantic type of window.

Returns:

#window_type=(wintype) ⇒ nil

Sets the semantic type of window to wintype.

Parameters:

Returns:

  • (nil)

#workspaceWnck::Workspace

Gets the current workspace window is on. If the window is pinned (on all workspaces), or not on any workspaces, nil may be returned. nil. The returned Wnck::Workspace is owned by libwnck and must not be referenced or unreferenced.

Returns:

#xidWnck::gulong

Gets the X window ID of window.

Returns:

  • (Wnck::gulong)

    the X window ID of window.