Class
MetaWindow
Description [src]
abstract class Meta.Window : GObject.Object
implements Gio.Initable {
/* No available fields */
}
A display-agnostic abstraction for a window.
MetaWindow
is the core abstraction in Mutter of a window. It has the
properties you’d expect, such as a title, whether it’s fullscreen,
has decorations, etc.
Since a lot of different kinds of windows exist, each window also a
MetaWindowType
which denotes which kind of window we’re exactly dealing
with. For example, one expects slightly different behaviour from a dialog
than a “normal” window. The type of a window can be queried with
meta_window_get_window_type()
.
Common API for windows include:
- Minimizing:
meta_window_minimize()
/meta_window_unminimize()
- Maximizing:
meta_window_maximize()
/meta_window_unmaximize()
- Fullscreen:
meta_window_make_fullscreen()
/meta_window_unmake_fullscreen()
/meta_window_is_fullscreen()
Each MetaWindow
is part of either one or all MetaWorkspace
s of the
desktop. You can activate a window on a certain workspace using
meta_window_activate_with_workspace()
, and query on which workspace it is
located using meta_window_located_on_workspace()
. The workspace it is part
of can be obtained using meta_window_get_workspace()
.
Each display protocol should make a subclass to be compatible with that
protocols’ specifics, for example MetaWindowX11
and MetaWindowWayland
.
This is independent of the protocol that the client uses, which is modeled
using the MetaWindowClientType
enum.
To integrate within the Clutter scene graph, which deals with the actual
rendering, each MetaWindow
will be part of a MetaWindowActor
.
Instance methods
meta_window_client_rect_to_frame_rect
Converts a desired bounds of the client window into the corresponding bounds of the window frame (excluding invisible borders and client side shadows.).
meta_window_find_root_ancestor
Follow the chain of parents of window
, skipping transient windows,
and return the “root” window which has no non-transient parent.
meta_window_foreach_ancestor
If window
is transient, call func
with the window for which it’s transient,
repeatedly until either we find a non-transient window, or func
returns FALSE
.
meta_window_foreach_transient
Call func
for every window which is either transient for window
, or is
a transient of a window which is in turn transient for window
.
The order of window enumeration is not defined.
meta_window_frame_rect_to_client_rect
Converts a desired frame bounds for a window into the bounds of the client window.
meta_window_get_client_content_rect
Gets the client rectangle that ATSPI window coordinates are relative to.
meta_window_get_frame_rect
Gets the rectangle that bounds window
that is what the user thinks of
as the edge of the window.
meta_window_get_maximized
Gets the current maximization state of the window, as combination
of the META_MAXIMIZE_HORIZONTAL
and META_MAXIMIZE_VERTICAL
flags;.
meta_window_get_pid
Returns the pid of the process that created this window, if available to the windowing system.
meta_window_get_sandboxed_app_id
Gets an unique id for a sandboxed app (currently flatpaks and snaps are supported).
meta_window_get_stable_sequence
The stable sequence number is a monotonicially increasing
unique integer assigned to each MetaWindow
upon creation.
meta_window_get_tile_match
Returns the matching tiled window on the same monitor as window
. This is
the topmost tiled window in a complementary tile mode that is:.
meta_window_get_transient_for
Returns the MetaWindow
for the window that is pointed to by the
WM_TRANSIENT_FOR hint on this window (see XGetTransientForHint()
or XSetTransientForHint()). Mutter keeps transient windows above their
parents. A typical usage of this hint is for a dialog that wants to stay
above its associated window.
meta_window_get_user_time
The user time represents a timestamp for the last time the user interacted with this window.
meta_window_get_wm_class_instance
Return the current value of the instance part of WM_CLASS
X property.
meta_window_get_work_area_for_monitor
Get the work area for window
, given the monitor index
which_monitor
.
meta_window_is_ancestor_of_transient
The function determines whether window
is an ancestor of transient
; it does
so by traversing the transient
‘s ancestors until it either locates window
or reaches an ancestor that is not transient.
meta_window_move_frame
Moves the window to the desired location on window’s assigned workspace, using the northwest edge of the frame as the reference, instead of the actual window’s origin, but only if a frame is present.
meta_window_move_resize_frame
Resizes the window so that its outer bounds (including frame) fit within the given rect.
meta_window_move_to_monitor
Moves the window to the monitor with index monitor
, keeping
the relative position of the window’s top left corner.
meta_window_protocol_to_stage_rect
Transform the coordinates from protocol coordinates to coordinates expected by the stage and internal window management logic.
meta_window_raise_and_make_recent_on_workspace
Raises a window and marks it as the most recently used window on the
workspace target_workspace
. If the window exists on all workspaces, it will
become the most recently used sticky window on all other workspaces. This
ensures proper tracking among windows on all workspaces while not overriding
MRU for other windows.
meta_window_stage_to_protocol_rect
Transform the coordinates from stage coordinates to protocol coordinates.
Methods inherited from GInitable (1)
g_initable_init
Initializes the object implementing the interface.
Signals
Meta.Window::highest-scale-monitor-changed
This is emitted when the monitor with the highest scale intersecting the window changes.
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.