Window
Object Hierarchy:
Description:
Namespace: Gdk
Package: gdk-3.0
Content:
Properties:
Static methods:
- public static unowned Window at_pointer (out int win_x, out int win_y)
Obtains the window underneath the mouse pointer, returning the location of that window in
win_x
,win_y
. - public static void constrain_size (Geometry geometry, WindowHints flags, int width, int height, out int new_width, out int new_height)
Constrains a desired width and height according to a set of geometry hints ( such as minimum and maximum size).
- public static void process_all_updates ()
Calls process_updates for all windows (see Window) in the application.
- public static void set_debug_updates (bool setting)
With update debugging enabled, calls to invalidate_region clear the invalidated region of the screen to a noticeable color, and GDK pauses for a short time before sending exposes to windows during process_updates.
Creation methods:
- public Window (Window? parent, WindowAttr attributes, WindowAttributesType attributes_mask)
Creates a new Window using the attributes from
attributes
.
Methods:
- public void add_filter (FilterFunc function)
Adds an event filter to this, allowing you to intercept events before they reach GDK.
- public void beep ()
Emits a short beep associated to this in the appropriate display, if supported.
- public unowned DrawingContext begin_draw_frame (Region region)
Indicates that you are beginning the process of redrawing
region
on this, and provides you with a DrawingContext. - public void begin_move_drag (int button, int root_x, int root_y, uint32 timestamp)
Begins a window move operation (for a toplevel window).
- public void begin_move_drag_for_device (Device device, int button, int root_x, int root_y, uint32 timestamp)
Begins a window move operation (for a toplevel window).
- public void begin_paint_rect (Rectangle rectangle)
A convenience wrapper around begin_paint_region which creates a rectangular region for you.
- public void begin_paint_region (Region region)
Indicates that you are beginning the process of redrawing
region
. - public void begin_resize_drag (WindowEdge edge, int button, int root_x, int root_y, uint32 timestamp)
Begins a window resize operation (for a toplevel window).
- public void begin_resize_drag_for_device (WindowEdge edge, Device device, int button, int root_x, int root_y, uint32 timestamp)
Begins a window resize operation (for a toplevel window).
- public void configure_finished ()
Does nothing, present only for compatiblity.
- public void coords_from_parent (double parent_x, double parent_y, out double x, out double y)
Transforms window coordinates from a parent window to a child window, where the parent window is the normal parent as returned by get_parent for normal windows, and the window's embedder as returned by offscreen_window_get_embedder for offscreen windows.
- public void coords_to_parent (double x, double y, out double parent_x, out double parent_y)
Transforms window coordinates from a child window to its parent window, where the parent window is the normal parent as returned by get_parent for normal windows, and the window's embedder as returned by offscreen_window_get_embedder for offscreen windows.
- public GLContext create_gl_context () throws Error
Creates a new GLContext matching the framebuffer format to the visual of the Window.
- public ImageSurface create_similar_image_surface (Format format, int width, int height, int scale)
Create a new image surface that is efficient to draw on the given this.
- public Surface create_similar_surface (Content content, int width, int height)
Create a new surface that is as compatible as possible with the given this.
- public void deiconify ()
Attempt to deiconify (unminimize) this.
- public void destroy ()
Destroys the window system resources associated with this and decrements this's reference count.
- public void enable_synchronized_configure ()
Does nothing, present only for compatiblity.
- public void end_draw_frame (DrawingContext context)
Indicates that the drawing of the contents of this started with
gdk_window_begin_frame
has been completed. - public void end_paint ()
Indicates that the backing store created by the most recent call to begin_paint_region should be copied onscreen and deleted, leaving the next-most-recent backing store or no backing store at all as the active paint region.
- public bool ensure_native ()
Tries to ensure that there is a window-system native window for this GdkWindow.
- public void flush ()
This function does nothing.
- public void focus (uint32 timestamp)
Sets keyboard focus to this.
- public void freeze_toplevel_updates_libgtk_only ()
Temporarily freezes a window and all its descendants such that it won't receive expose events.
- public void freeze_updates ()
Temporarily freezes a window such that it won’t receive expose events.
- public void fullscreen ()
Moves the window into fullscreen mode.
- public void fullscreen_on_monitor (int monitor)
Moves the window into fullscreen mode on the given monitor.
- public void geometry_changed ()
This function informs GDK that the geometry of an embedded offscreen window has changed.
- public bool get_accept_focus ()
Determines whether or not the desktop environment shuld be hinted that the window does not want to receive input focus.
- public unowned Pattern? get_background_pattern ()
Gets the pattern used to clear the background on this.
- public List<unowned Window> get_children ()
Gets the list of children of this known to GDK.
- public List<unowned Window> get_children_with_user_data (void* user_data)
Gets the list of children of this known to GDK with a particular
user_data
set on it. - public Region get_clip_region ()
Computes the region of a window that potentially can be written to by drawing primitives.
- public bool get_composited ()
Determines whether this is composited.
- public unowned Cursor? get_cursor ()
Retrieves a Cursor pointer for the cursor currently set on the specified Window, or null.
- public bool get_decorations (out WMDecoration decorations)
Returns the decorations set on the GdkWindow with set_decorations.
- public unowned Cursor? get_device_cursor (Device device)
Retrieves a Cursor pointer for the
device
currently set on the specified Window, or null . - public EventMask get_device_events (Device device)
Returns the event mask for this corresponding to an specific device.
- public unowned Window? get_device_position (Device device, out int x, out int y, out ModifierType mask)
Obtains the current device position and modifier state.
- public unowned Window? get_device_position_double (Device device, out double x, out double y, out ModifierType mask)
Obtains the current device position in doubles and modifier state.
- public unowned Display get_display ()
Gets the Display associated with a Window.
- public DragProtocol get_drag_protocol (out Window target)
Finds out the DND protocol supported by a window.
- public unowned Window get_effective_parent ()
Obtains the parent of this, as known to GDK.
- public unowned Window get_effective_toplevel ()
Gets the toplevel window that’s an ancestor of this.
- public bool get_event_compression ()
Get the current event compression setting for this window.
- public EventMask get_events ()
Gets the event mask for this for all master input devices.
- public bool get_focus_on_map ()
Determines whether or not the desktop environment should be hinted that the window does not want to receive input focus when it is mapped.
- public unowned FrameClock get_frame_clock ()
Gets the frame clock for the window.
- public void get_frame_extents (out Rectangle rect)
Obtains the bounding box of the window, including window manager titlebar/borders if any.
- public FullscreenMode get_fullscreen_mode ()
Obtains the FullscreenMode of the this.
- public void get_geometry (out int x, out int y, out int width, out int height)
Any of the return location arguments to this function may be null, if you aren’t interested in getting the value of that field.
- public unowned Window get_group ()
Returns the group leader window for this.
- public int get_height ()
Returns the height of the given this.
- public bool get_modal_hint ()
Determines whether or not the window manager is hinted that this has modal behaviour.
- public int get_origin (out int x, out int y)
Obtains the position of a window in root window coordinates.
- public unowned Window get_parent ()
Obtains the parent of this, as known to GDK.
- public bool get_pass_through ()
Returns whether input to the window is passed through to the window below.
- public unowned Window? get_pointer (out int x, out int y, out ModifierType mask)
Obtains the current pointer position and modifier state.
- public void get_position (out int x, out int y)
Obtains the position of the window as reported in the most-recently-processed EventConfigure.
- public void get_root_coords (int x, int y, out int root_x, out int root_y)
Obtains the position of a window position in root window coordinates.
- public void get_root_origin (out int x, out int y)
Obtains the top-left corner of the window manager frame in root window coordinates.
- public int get_scale_factor ()
Returns the internal scale factor that maps from window coordiantes to the actual device pixels.
- public unowned Screen get_screen ()
Gets the Screen associated with a Window.
- public EventMask get_source_events (InputSource source)
Returns the event mask for this corresponding to the device class specified by
source
. - public WindowState get_state ()
Gets the bitwise OR of the currently active window state flags, from the WindowState enumeration.
- public bool get_support_multidevice ()
Returns true if the window is aware of the existence of multiple devices.
- public unowned Window get_toplevel ()
Gets the toplevel window that’s an ancestor of this.
- public WindowTypeHint get_type_hint ()
This function returns the type hint set for a window.
- public Region get_update_area ()
Transfers ownership of the update area from this to the caller of the function.
- public void get_user_data (out void* data)
Retrieves the user data for this, which is normally the widget that this belongs to.
- public Region get_visible_region ()
Computes the region of the this that is potentially visible.
- public unowned Visual get_visual ()
Gets the Visual describing the pixel format of this.
- public int get_width ()
Returns the width of the given this.
- public WindowType get_window_type ()
Gets the type of the window.
- public bool has_native ()
Checks whether the window has a native window or not.
- public void hide ()
For toplevel windows, withdraws them, so they will no longer be known to the window manager; for all windows, unmaps them, so they won’t be displayed.
- public void iconify ()
Asks to iconify (minimize) this.
- public void input_shape_combine_region (Region shape_region, int offset_x, int offset_y)
Like shape_combine_region, but the shape applies only to event handling.
- public void invalidate_maybe_recurse (Region region, WindowChildFunc? child_func)
Adds
region
to the update area for this. - public void invalidate_rect (Rectangle? rect, bool invalidate_children)
A convenience wrapper around invalidate_region which invalidates a rectangular region.
- public void invalidate_region (Region region, bool invalidate_children)
Adds
region
to the update area for this. - public bool is_destroyed ()
Check to see if a window is destroyed.
- public bool is_input_only ()
Determines whether or not the window is an input only window.
- public bool is_shaped ()
Determines whether or not the window is shaped.
- public bool is_viewable ()
Check if the window and all ancestors of the window are mapped.
- public bool is_visible ()
Checks whether the window has been mapped (with show or show_unraised).
- public void lower ()
Lowers this to the bottom of the Z-order ( stacking order), so that other windows with the same parent window appear above this.
- public void mark_paint_from_clip (Context cr)
If you call this during a paint (e.
- public void maximize ()
Maximizes the window.
- public void merge_child_input_shapes ()
Merges the input shape masks for any child windows into the input shape mask for this.
- public void merge_child_shapes ()
Merges the shape masks for any child windows into the shape mask for this.
- public void move (int x, int y)
Repositions a window relative to its parent window.
- public void move_region (Region region, int dx, int dy)
Move the part of this indicated by
region
bydy
pixels in the Y direction anddx
pixels in the X direction. - public void move_resize (int x, int y, int width, int height)
- public void move_to_rect (Rectangle rect, Gravity rect_anchor, Gravity window_anchor, AnchorHints anchor_hints, int rect_anchor_dx, int rect_anchor_dy)
Moves this to
rect
, aligning their anchor points. - public unowned List<Window> peek_children ()
Like get_children, but does not copy the list of children, so the list does not need to be freed.
- public void process_updates (bool update_children)
Sends one or more expose events to this.
- public void raise ()
Raises this to the top of the Z-order ( stacking order), so that other windows with the same parent window appear below this.
- public void register_dnd ()
Registers a window as a potential drop destination.
- public void remove_filter (FilterFunc function)
Remove a filter previously added with add_filter.
- public void reparent (Window new_parent, int x, int y)
Reparents this into the given
new_parent
. - public void resize (int width, int height)
Resizes this; for toplevel windows, asks the window manager to resize the window.
- public void restack (Window? sibling, bool above)
Changes the position of this in the Z-order (stacking order), so that it is above
sibling
(ifabove
is true) or belowsibling
(ifabove
is false). - public void scroll (int dx, int dy)
Scroll the contents of this, both pixels and children, by the given amount.
- public void set_accept_focus (bool accept_focus)
Setting
accept_focus
to false hints the desktop environment that the window doesn’t want to receive input focus. - public void set_background (Color color)
Sets the background color of this.
- public void set_background_pattern (Pattern? pattern)
Sets the background of this.
- public void set_background_rgba (RGBA rgba)
Sets the background color of this.
- public void set_child_input_shapes ()
Sets the input shape mask of this to the union of input shape masks for all children of this, ignoring the input shape mask of this itself.
- public void set_child_shapes ()
Sets the shape mask of this to the union of shape masks for all children of this, ignoring the shape mask of this itself.
- public void set_composited (bool composited)
Sets a Window as composited, or unsets it.
- public void set_cursor (Cursor? cursor)
Sets the default mouse pointer for a Window.
- public void set_decorations (WMDecoration decorations)
“Decorations” are the features the window manager adds to a toplevel Window.
- public void set_device_cursor (Device device, Cursor cursor)
Sets a specific Cursor for a given device when it gets inside this.
- public void set_device_events (Device device, EventMask event_mask)
Sets the event mask for a given device (Normally a floating device, not attached to any visible pointer) to this.
- public void set_event_compression (bool event_compression)
Determines whether or not extra unprocessed motion events in the event queue can be discarded.
- public void set_events (EventMask event_mask)
The event mask for a window determines which events will be reported for that window from all master input devices.
- public void set_focus_on_map (bool focus_on_map)
Setting
focus_on_map
to false hints the desktop environment that the window doesn’t want to receive input focus when it is mapped. - public void set_fullscreen_mode (FullscreenMode mode)
Specifies whether the this should span over all monitors (in a multi-head setup) or only the current monitor when in fullscreen mode.
- public void set_functions (WMFunction functions)
Sets hints about the window management functions to make available via buttons on the window frame.
- public void set_geometry_hints (Geometry geometry, WindowHints geom_mask)
Sets the geometry hints for this.
- public void set_group (Window? leader)
Sets the group leader window for this.
- public void set_icon_list (List<Pixbuf> pixbufs)
Sets a list of icons for the window.
- public void set_icon_name (string? name)
Windows may have a name used while minimized, distinct from the name they display in their titlebar.
- public void set_keep_above (bool setting)
Set if this must be kept above other windows.
- public void set_keep_below (bool setting)
Set if this must be kept below other windows.
- public void set_modal_hint (bool modal)
The application can use this hint to tell the window manager that a certain window has modal behaviour.
- public void set_opacity (double opacity)
Set this to render as partially transparent, with opacity 0 being fully transparent and 1 fully opaque.
- public void set_opaque_region (Region? region)
For optimisation purposes, compositing window managers may like to not draw obscured regions of windows, or turn off blending during for these regions.
- public void set_override_redirect (bool override_redirect)
An override redirect window is not under the control of the window manager.
- public void set_pass_through (bool pass_through)
Sets whether input to the window is passed through to the window below.
- public void set_role (string role)
When using GTK+, typically you should use
gtk_window_set_role
instead of this low-level function. - public void set_shadow_width (int left, int right, int top, int bottom)
Newer GTK+ windows using client-side decorations use extra geometry around their frames for effects like shadows and invisible borders.
- public void set_skip_pager_hint (bool skips_pager)
Toggles whether a window should appear in a pager (workspace switcher, or other desktop utility program that displays a small thumbnail representation of the windows on the desktop).
- public void set_skip_taskbar_hint (bool skips_taskbar)
Toggles whether a window should appear in a task list or window list.
- public void set_source_events (InputSource source, EventMask event_mask)
Sets the event mask for any floating device (i.
- public void set_startup_id (string startup_id)
When using GTK+, typically you should use
gtk_window_set_startup_id
instead of this low-level function. - public bool set_static_gravities (bool use_static)
Used to set the bit gravity of the given window to static, and flag it so all children get static subwindow gravity.
- public void set_support_multidevice (bool support_multidevice)
This function will enable multidevice features in this.
- public void set_title (string title)
Sets the title of a toplevel window, to be displayed in the titlebar.
- public void set_transient_for (Window parent)
Indicates to the window manager that this is a transient dialog associated with the application window
parent
. - public void set_type_hint (WindowTypeHint hint)
The application can use this call to provide a hint to the window manager about the functionality of a window.
- public void set_urgency_hint (bool urgent)
Toggles whether a window needs the user's urgent attention.
- public void set_user_data (Object? user_data)
For most purposes this function is deprecated in favor of
g_object_set_data
. - public void shape_combine_region (Region? shape_region, int offset_x, int offset_y)
Makes pixels in this outside
shape_region
be transparent, so that the window may be nonrectangular. - public void show ()
Like show_unraised, but also raises the window to the top of the window stack (moves the window to the front of the Z-order).
- public void show_unraised ()
Shows a Window onscreen, but does not modify its stacking order.
- public bool show_window_menu (Event event)
Asks the windowing system to show the window menu.
- public void stick ()
“Pins” a window such that it’s on all workspaces and does not scroll with viewports, for window managers that have scrollable viewports.
- public void thaw_toplevel_updates_libgtk_only ()
Thaws a window frozen with freeze_toplevel_updates_libgtk_only.
- public void thaw_updates ()
Thaws a window frozen with freeze_updates.
- public void unfullscreen ()
Moves the window out of fullscreen mode.
- public void unmaximize ()
Unmaximizes the window.
- public void unstick ()
- public void withdraw ()
Withdraws a window (unmaps it and asks the window manager to forget about it ).
Signals:
- public virtual signal Surface create_surface (int width, int height)
The create_surface signal is emitted when an offscreen window needs its surface (re)created, which happens either when the window is first drawn to, or when the window is being resized.
- public virtual signal void from_embedder (double embedder_x, double embedder_y, out double offscreen_x, out double offscreen_y)
The from_embedder signal is emitted to translate coordinates in the embedder of an offscreen window to the offscreen window.
- public signal void moved_to_rect (Rectangle flipped_rect, Rectangle final_rect, bool flipped_x, bool flipped_y)
Emitted when the position of
window
is finalized after being moved to a destination rectangle. - public signal unowned Window? pick_embedded_child (double x, double y)
The pick_embedded_child signal is emitted to find an embedded child at the given position.
- public virtual signal void to_embedder (double offscreen_x, double offscreen_y, out double embedder_x, out double embedder_y)
The to_embedder signal is emitted to translate coordinates in an offscreen window to its embedder.
Inherited Members:
All known members inherited from class GLib.Object