Synopsis#include <gdk/gdk.h> struct GdkWindow; enum GdkWindowType; enum GdkWindowClass; enum GdkWindowHints; GdkGeometry; enum GdkGravity; enum GdkWindowEdge; enum GdkWindowTypeHint; GdkWindowAttr; enum GdkWindowAttributesType; GdkWindow* gdk_window_new (GdkWindow *parent, GdkWindowAttr *attributes, gint attributes_mask); void gdk_window_destroy (GdkWindow *window); #define gdk_window_ref #define gdk_window_unref GdkWindowType gdk_window_get_window_type (GdkWindow *window); GdkWindow* gdk_window_at_pointer (gint *win_x, gint *win_y); void gdk_window_show (GdkWindow *window); void gdk_window_show_unraised (GdkWindow *window); void gdk_window_hide (GdkWindow *window); gboolean gdk_window_is_visible (GdkWindow *window); gboolean gdk_window_is_viewable (GdkWindow *window); GdkWindowState gdk_window_get_state (GdkWindow *window); void gdk_window_withdraw (GdkWindow *window); void gdk_window_iconify (GdkWindow *window); void gdk_window_deiconify (GdkWindow *window); void gdk_window_stick (GdkWindow *window); void gdk_window_unstick (GdkWindow *window); void gdk_window_maximize (GdkWindow *window); void gdk_window_unmaximize (GdkWindow *window); void gdk_window_fullscreen (GdkWindow *window); void gdk_window_unfullscreen (GdkWindow *window); void gdk_window_set_keep_above (GdkWindow *window, gboolean setting); void gdk_window_set_keep_below (GdkWindow *window, gboolean setting); void gdk_window_set_opacity (GdkWindow *window, gdouble opacity); void gdk_window_set_composited (GdkWindow *window, gboolean composited); void gdk_window_move (GdkWindow *window, gint x, gint y); void gdk_window_resize (GdkWindow *window, gint width, gint height); void gdk_window_move_resize (GdkWindow *window, gint x, gint y, gint width, gint height); void gdk_window_scroll (GdkWindow *window, gint dx, gint dy); void gdk_window_move_region (GdkWindow *window, const GdkRegion *region, gint dx, gint dy); void gdk_window_reparent (GdkWindow *window, GdkWindow *new_parent, gint x, gint y); void gdk_window_clear (GdkWindow *window); void gdk_window_clear_area (GdkWindow *window, gint x, gint y, gint width, gint height); void gdk_window_clear_area_e (GdkWindow *window, gint x, gint y, gint width, gint height); #define gdk_window_copy_area (drawable,gc,x,y,source_drawable,source_x,source_y,width,height) void gdk_window_raise (GdkWindow *window); void gdk_window_lower (GdkWindow *window); void gdk_window_focus (GdkWindow *window, guint32 timestamp); void gdk_window_register_dnd (GdkWindow *window); void gdk_window_begin_resize_drag (GdkWindow *window, GdkWindowEdge edge, gint button, gint root_x, gint root_y, guint32 timestamp); void gdk_window_begin_move_drag (GdkWindow *window, gint button, gint root_x, gint root_y, guint32 timestamp); void gdk_window_constrain_size (GdkGeometry *geometry, guint flags, gint width, gint height, gint *new_width, gint *new_height); void gdk_window_beep (GdkWindow *window); void gdk_window_begin_paint_rect (GdkWindow *window, const GdkRectangle *rectangle); void gdk_window_begin_paint_region (GdkWindow *window, const GdkRegion *region); void gdk_window_end_paint (GdkWindow *window); void gdk_window_invalidate_rect (GdkWindow *window, const GdkRectangle *rect, gboolean invalidate_children); void gdk_window_invalidate_region (GdkWindow *window, const GdkRegion *region, gboolean invalidate_children); void gdk_window_invalidate_maybe_recurse (GdkWindow *window, const GdkRegion *region, gboolean (child_funcGdkWindow *, gpointer) (), gpointer user_data); GdkRegion* gdk_window_get_update_area (GdkWindow *window); void gdk_window_freeze_updates (GdkWindow *window); void gdk_window_thaw_updates (GdkWindow *window); void gdk_window_process_all_updates (void); void gdk_window_process_updates (GdkWindow *window, gboolean update_children); void gdk_window_set_debug_updates (gboolean setting); void gdk_window_get_internal_paint_info (GdkWindow *window, GdkDrawable **real_drawable, gint *x_offset, gint *y_offset); void gdk_window_enable_synchronized_configure (GdkWindow *window); void gdk_window_configure_finished (GdkWindow *window); void gdk_window_set_user_data (GdkWindow *window, gpointer user_data); void gdk_window_set_override_redirect (GdkWindow *window, gboolean override_redirect); void gdk_window_set_accept_focus (GdkWindow *window, gboolean accept_focus); void gdk_window_set_focus_on_map (GdkWindow *window, gboolean focus_on_map); void gdk_window_add_filter (GdkWindow *window, GdkFilterFunc function, gpointer data); void gdk_window_remove_filter (GdkWindow *window, GdkFilterFunc function, gpointer data); GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent, GdkEvent *event, gpointer data); enum GdkFilterReturn; typedef GdkXEvent; void gdk_window_shape_combine_mask (GdkWindow *window, GdkBitmap *mask, gint x, gint y); void gdk_window_shape_combine_region (GdkWindow *window, const GdkRegion *shape_region, gint offset_x, gint offset_y); void gdk_window_set_child_shapes (GdkWindow *window); void gdk_window_merge_child_shapes (GdkWindow *window); void gdk_window_input_shape_combine_mask (GdkWindow *window, GdkBitmap *mask, gint x, gint y); void gdk_window_input_shape_combine_region (GdkWindow *window, const GdkRegion *shape_region, gint offset_x, gint offset_y); void gdk_window_set_child_input_shapes (GdkWindow *window); void gdk_window_merge_child_input_shapes (GdkWindow *window); gboolean gdk_window_set_static_gravities (GdkWindow *window, gboolean use_static); void gdk_window_set_hints (GdkWindow *window, gint x, gint y, gint min_width, gint min_height, gint max_width, gint max_height, gint flags); void gdk_window_set_title (GdkWindow *window, const gchar *title); void gdk_window_set_background (GdkWindow *window, const GdkColor *color); void gdk_window_set_back_pixmap (GdkWindow *window, GdkPixmap *pixmap, gboolean parent_relative); #define GDK_PARENT_RELATIVE void gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor); #define gdk_window_set_colormap void gdk_window_get_user_data (GdkWindow *window, gpointer *data); void gdk_window_get_geometry (GdkWindow *window, gint *x, gint *y, gint *width, gint *height, gint *depth); void gdk_window_set_geometry_hints (GdkWindow *window, const GdkGeometry *geometry, GdkWindowHints geom_mask); void gdk_window_set_icon_list (GdkWindow *window, GList *pixbufs); void gdk_window_set_modal_hint (GdkWindow *window, gboolean modal); void gdk_window_set_type_hint (GdkWindow *window, GdkWindowTypeHint hint); GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window); void gdk_window_set_skip_taskbar_hint (GdkWindow *window, gboolean skips_taskbar); void gdk_window_set_skip_pager_hint (GdkWindow *window, gboolean skips_pager); void gdk_window_set_urgency_hint (GdkWindow *window, gboolean urgent); void gdk_window_get_position (GdkWindow *window, gint *x, gint *y); void gdk_window_get_root_origin (GdkWindow *window, gint *x, gint *y); void gdk_window_get_frame_extents (GdkWindow *window, GdkRectangle *rect); #define gdk_window_get_size #define gdk_window_get_visual #define gdk_window_get_colormap #define gdk_window_get_type gint gdk_window_get_origin (GdkWindow *window, gint *x, gint *y); gboolean gdk_window_get_deskrelative_origin (GdkWindow *window, gint *x, gint *y); GdkWindow* gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask); enum GdkModifierType; GdkWindow* gdk_window_get_parent (GdkWindow *window); GdkWindow* gdk_window_get_toplevel (GdkWindow *window); GList* gdk_window_get_children (GdkWindow *window); GList* gdk_window_peek_children (GdkWindow *window); GdkEventMask gdk_window_get_events (GdkWindow *window); void gdk_window_set_events (GdkWindow *window, GdkEventMask event_mask); void gdk_window_set_icon (GdkWindow *window, GdkWindow *icon_window, GdkPixmap *pixmap, GdkBitmap *mask); void gdk_window_set_icon_name (GdkWindow *window, const gchar *name); void gdk_window_set_transient_for (GdkWindow *window, GdkWindow *parent); void gdk_window_set_role (GdkWindow *window, const gchar *role); void gdk_window_set_startup_id (GdkWindow *window, const gchar *startup_id); void gdk_window_set_group (GdkWindow *window, GdkWindow *leader); GdkWindow* gdk_window_get_group (GdkWindow *window); void gdk_window_set_decorations (GdkWindow *window, GdkWMDecoration decorations); gboolean gdk_window_get_decorations (GdkWindow *window, GdkWMDecoration *decorations); enum GdkWMDecoration; void gdk_window_set_functions (GdkWindow *window, GdkWMFunction functions); enum GdkWMFunction; GList* gdk_window_get_toplevels (void); GdkWindow* gdk_get_default_root_window (void); GdkPointerHooks; GdkPointerHooks* gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); void gdk_window_redirect_to_drawable (GdkWindow *window, GdkDrawable *drawable, gint src_x, gint src_y, gint dest_x, gint dest_y, gint width, gint height); void gdk_window_remove_redirection (GdkWindow *window); DescriptionA GdkWindow is a rectangular region on the screen. It's a low-level object, used to implement high-level objects such as GtkWidget and GtkWindow on the GTK+ level. A GtkWindow is a toplevel window, the thing a user might think of as a "window" with a titlebar and so on; a GtkWindow may contain many GdkWindow. For example, each GtkButton has a GdkWindow associated with it. Example 7. Composited windows #include <gtk/gtk.h> /* The expose event handler for the event box. * * This function simply draws a transparency onto a widget on the area * for which it receives expose events. This is intended to give the * event box a "transparent" background. * * In order for this to work properly, the widget must have an RGBA * colourmap. The widget should also be set as app-paintable since it * doesn't make sense for GTK+ to draw a background if we are drawing it * (and because GTK+ might actually replace our transparency with its * default background colour). */ static gboolean transparent_expose (GtkWidget *widget, GdkEventExpose *event) { cairo_t *cr; cr = gdk_cairo_create (widget->window); cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR); gdk_cairo_region (cr, event->region); cairo_fill (cr); cairo_destroy (cr); return FALSE; } /* The expose event handler for the window. * * This function performs the actual compositing of the event box onto * the already-existing background of the window at 50% normal opacity. * * In this case we do not want app-paintable to be set on the widget * since we want it to draw its own (red) background. Because of this, * however, we must ensure that we use g_signal_connect_after so that * this handler is called after the red has been drawn. If it was * called before then GTK would just blindly paint over our work. * * Note: if the child window has children, then you need a cairo 1.16 * feature to make this work correctly. */ static gboolean window_expose_event (GtkWidget *widget, GdkEventExpose *event) { GdkRegion *region; GtkWidget *child; cairo_t *cr; /* get our child (in this case, the event box) */ child = gtk_bin_get_child (GTK_BIN (widget)); /* create a cairo context to draw to the window */ cr = gdk_cairo_create (widget->window); /* the source data is the (composited) event box */ gdk_cairo_set_source_pixmap (cr, child->window, child->allocation.x, child->allocation.y); /* draw no more than our expose event intersects our child */ region = gdk_region_rectangle (&child->allocation); gdk_region_intersect (region, event->region); gdk_cairo_region (cr, region); cairo_clip (cr); /* composite, with a 50% opacity */ cairo_set_operator (cr, CAIRO_OPERATOR_OVER); cairo_paint_with_alpha (cr, 0.5); /* we're done */ cairo_destroy (cr); return FALSE; } int main (int argc, char **argv) { GtkWidget *window, *event, *button; GdkScreen *screen; GdkColormap *rgba; GdkColor red; gtk_init (&argc, &argv); /* Make the widgets */ button = gtk_button_new_with_label ("A Button"); event = gtk_event_box_new (); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); /* Put a red background on the window */ gdk_color_parse ("red", &red); gtk_widget_modify_bg (window, GTK_STATE_NORMAL, &red); /* Set the colourmap for the event box. * Must be done before the event box is realised. */ screen = gtk_widget_get_screen (event); rgba = gdk_screen_get_rgba_colormap (screen); gtk_widget_set_colormap (event, rgba); /* Set our event box to have a fully-transparent background * drawn on it. Currently there is no way to simply tell GTK+ * that "transparency" is the background colour for a widget. */ gtk_widget_set_app_paintable (GTK_WIDGET (event), TRUE); g_signal_connect (event, "expose-event", G_CALLBACK (transparent_expose), NULL); /* Put them inside one another */ gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_container_add (GTK_CONTAINER (window), event); gtk_container_add (GTK_CONTAINER (event), button); /* Realise and show everything */ gtk_widget_show_all (window); /* Set the event box GdkWindow to be composited. * Obviously must be performed after event box is realised. */ gdk_window_set_composited (event->window, TRUE); /* Set up the compositing handler. * Note that we do _after_ so that the normal (red) background is drawn * by gtk before our compositing occurs. */ g_signal_connect_after (window, "expose-event", G_CALLBACK (window_expose_event), NULL); gtk_main (); return 0; } In the example Example 7, “Composited windows”, a button is placed inside of an event box inside of a window. The event box is set as composited and therefore is no longer automatically drawn to the screen. When the contents of the event box change, an expose event is generated on its parent window (which, in this case, belongs to the toplevel GtkWindow). The expose handler for this widget is responsible for merging the changes back on the screen in the way that it wishes. In our case, we merge the contents with a 50% transparency. We also set the background colour of the window to red. The effect is that the background shows through the button. Detailsstruct GdkWindowstruct GdkWindow; An opaque structure representing an onscreen drawable. Pointers to structures of type GdkPixmap, GdkBitmap, and GdkWindow, can often be used interchangeably. The type GdkDrawable refers generically to any of these types. enum GdkWindowTypetypedef enum { GDK_WINDOW_ROOT, GDK_WINDOW_TOPLEVEL, GDK_WINDOW_CHILD, GDK_WINDOW_DIALOG, GDK_WINDOW_TEMP, GDK_WINDOW_FOREIGN } GdkWindowType; Describes the kind of window.
enum GdkWindowClasstypedef enum { GDK_INPUT_OUTPUT, GDK_INPUT_ONLY } GdkWindowClass;
enum GdkWindowHintstypedef enum { GDK_HINT_POS = 1 << 0, GDK_HINT_MIN_SIZE = 1 << 1, GDK_HINT_MAX_SIZE = 1 << 2, GDK_HINT_BASE_SIZE = 1 << 3, GDK_HINT_ASPECT = 1 << 4, GDK_HINT_RESIZE_INC = 1 << 5, GDK_HINT_WIN_GRAVITY = 1 << 6, GDK_HINT_USER_POS = 1 << 7, GDK_HINT_USER_SIZE = 1 << 8 } GdkWindowHints;
Used to indicate which fields of a GdkGeometry struct should be paid attention
to. Also, the presence/absence of
GdkGeometrytypedef struct { gint min_width; gint min_height; gint max_width; gint max_height; gint base_width; gint base_height; gint width_inc; gint height_inc; gdouble min_aspect; gdouble max_aspect; GdkGravity win_gravity; } GdkGeometry;
The GdkGeometry struct gives the window manager information about
a window's geometry constraints. Normally you would set these on
the GTK+ level using
The canonical use-case for Here's an example of how the terminal example would be implemented, assuming a terminal area widget called "terminal" and a toplevel window "toplevel": GdkGeometry hints; hints.base_width = terminal->char_width; hints.base_height = terminal->char_height; hints.min_width = terminal->char_width; hints.min_height = terminal->char_height; hints.width_inc = terminal->char_width; hints.height_inc = terminal->char_height; gtk_window_set_geometry_hints (GTK_WINDOW (toplevel), GTK_WIDGET (terminal), &hints, GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE);
The other useful fields are the
enum GdkGravitytypedef enum { GDK_GRAVITY_NORTH_WEST = 1, GDK_GRAVITY_NORTH, GDK_GRAVITY_NORTH_EAST, GDK_GRAVITY_WEST, GDK_GRAVITY_CENTER, GDK_GRAVITY_EAST, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_SOUTH, GDK_GRAVITY_SOUTH_EAST, GDK_GRAVITY_STATIC } GdkGravity;
Defines the reference point of a window and the meaning of coordinates
passed to
enum GdkWindowEdgetypedef enum { GDK_WINDOW_EDGE_NORTH_WEST, GDK_WINDOW_EDGE_NORTH, GDK_WINDOW_EDGE_NORTH_EAST, GDK_WINDOW_EDGE_WEST, GDK_WINDOW_EDGE_EAST, GDK_WINDOW_EDGE_SOUTH_WEST, GDK_WINDOW_EDGE_SOUTH, GDK_WINDOW_EDGE_SOUTH_EAST } GdkWindowEdge; Determines a window edge or corner.
enum GdkWindowTypeHinttypedef enum { GDK_WINDOW_TYPE_HINT_NORMAL, GDK_WINDOW_TYPE_HINT_DIALOG, GDK_WINDOW_TYPE_HINT_MENU, /* Torn off menu */ GDK_WINDOW_TYPE_HINT_TOOLBAR, GDK_WINDOW_TYPE_HINT_SPLASHSCREEN, GDK_WINDOW_TYPE_HINT_UTILITY, GDK_WINDOW_TYPE_HINT_DOCK, GDK_WINDOW_TYPE_HINT_DESKTOP, GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU, /* A drop down menu (from a menubar) */ GDK_WINDOW_TYPE_HINT_POPUP_MENU, /* A popup menu (from right-click) */ GDK_WINDOW_TYPE_HINT_TOOLTIP, GDK_WINDOW_TYPE_HINT_NOTIFICATION, GDK_WINDOW_TYPE_HINT_COMBO, GDK_WINDOW_TYPE_HINT_DND } GdkWindowTypeHint; These are hints for the window manager that indicate what type of function the window has. The window manager can use this when determining decoration and behaviour of the window. The hint must be set before mapping the window. See the Extended Window Manager Hints specification for more details about window types.
GdkWindowAttrtypedef struct { gchar *title; gint event_mask; gint x, y; gint width; gint height; GdkWindowClass wclass; GdkVisual *visual; GdkColormap *colormap; GdkWindowType window_type; GdkCursor *cursor; gchar *wmclass_name; gchar *wmclass_class; gboolean override_redirect; GdkWindowTypeHint type_hint; } GdkWindowAttr; Attributes to use for a newly-created window.
enum GdkWindowAttributesTypetypedef enum { GDK_WA_TITLE = 1 << 1, GDK_WA_X = 1 << 2, GDK_WA_Y = 1 << 3, GDK_WA_CURSOR = 1 << 4, GDK_WA_COLORMAP = 1 << 5, GDK_WA_VISUAL = 1 << 6, GDK_WA_WMCLASS = 1 << 7, GDK_WA_NOREDIR = 1 << 8, GDK_WA_TYPE_HINT = 1 << 9 } GdkWindowAttributesType;
Used to indicate which fields in the GdkWindowAttr struct should be
honored. For example, if you filled in the "cursor" and "x" fields of
GdkWindowAttr, pass "
gdk_window_new ()GdkWindow* gdk_window_new (GdkWindow *parent, GdkWindowAttr *attributes, gint attributes_mask);
Creates a new GdkWindow using the attributes from
gdk_window_destroy ()void gdk_window_destroy (GdkWindow *window);
Destroys the window system resources associated with Note that a window will not be destroyed automatically when its reference count reaches zero. You must call this function yourself before that happens.
gdk_window_ref#define gdk_window_ref gdk_drawable_ref Warning
Deprecated equivalent of
gdk_window_unref#define gdk_window_unref gdk_drawable_unref Warning
Deprecated equivalent of gdk_window_get_window_type ()GdkWindowType gdk_window_get_window_type (GdkWindow *window); Gets the type of the window. See GdkWindowType.
gdk_window_at_pointer ()GdkWindow* gdk_window_at_pointer (gint *win_x, gint *win_y);
Obtains the window underneath the mouse pointer, returning the
location of that window in
NOTE: For multihead-aware widgets or applications use
gdk_window_show ()void gdk_window_show (GdkWindow *window);
Like
This function maps a window so it's visible onscreen. Its opposite
is When implementing a GtkWidget, you should call this function on the widget's GdkWindow as part of the "map" method.
gdk_window_show_unraised ()void gdk_window_show_unraised (GdkWindow *window);
Shows a GdkWindow onscreen, but does not modify its stacking
order. In contrast,
On the X11 platform, in Xlib terms, this function calls
gdk_window_hide ()void gdk_window_hide (GdkWindow *window);
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. Normally done automatically as
part of
gdk_window_is_visible ()gboolean gdk_window_is_visible (GdkWindow *window);
Checks whether the window has been mapped (with
gdk_window_is_viewable ()gboolean gdk_window_is_viewable (GdkWindow *window); Check if the window and all ancestors of the window are mapped. (This is not necessarily "viewable" in the X sense, since we only check as far as we have GDK window parents, not to the root window.)
gdk_window_get_state ()GdkWindowState gdk_window_get_state (GdkWindow *window); Gets the bitwise OR of the currently active window state flags, from the GdkWindowState enumeration.
gdk_window_withdraw ()void gdk_window_withdraw (GdkWindow *window);
Withdraws a window (unmaps it and asks the window manager to forget about it).
This function is not really useful as
gdk_window_iconify ()void gdk_window_iconify (GdkWindow *window);
Asks to iconify (minimize)
This function only makes sense when
gdk_window_deiconify ()void gdk_window_deiconify (GdkWindow *window);
Attempt to deiconify (unminimize)
gdk_window_stick ()void gdk_window_stick (GdkWindow *window);
"Pins" a window such that it's on all workspaces and does not scroll
with viewports, for window managers that have scrollable viewports.
(When using GtkWindow, On the X11 platform, this function depends on window manager support, so may have no effect with many window managers. However, GDK will do the best it can to convince the window manager to stick the window. For window managers that don't support this operation, there's nothing you can do to force it to happen.
gdk_window_unstick ()void gdk_window_unstick (GdkWindow *window);
Reverse operation for
gdk_window_maximize ()void gdk_window_maximize (GdkWindow *window); Maximizes the window. If the window was already maximized, then this function does nothing.
On X11, asks the window manager to maximize On Windows, reliably maximizes the window.
gdk_window_unmaximize ()void gdk_window_unmaximize (GdkWindow *window); Unmaximizes the window. If the window wasn't maximized, then this function does nothing.
On X11, asks the window manager to unmaximize On Windows, reliably unmaximizes the window.
gdk_window_fullscreen ()void gdk_window_fullscreen (GdkWindow *window); Moves the window into fullscreen mode. This means the window covers the entire screen and is above any panels or task bars. If the window was already fullscreen, then this function does nothing.
On X11, asks the window manager to put
Since 2.2 gdk_window_unfullscreen ()void gdk_window_unfullscreen (GdkWindow *window); Moves the window out of fullscreen mode. If the window was not fullscreen, does nothing.
On X11, asks the window manager to move
Since 2.2 gdk_window_set_keep_above ()void gdk_window_set_keep_above (GdkWindow *window, gboolean setting);
Set if
On X11, asks the window manager to keep
Since 2.4 gdk_window_set_keep_below ()void gdk_window_set_keep_below (GdkWindow *window, gboolean setting);
Set if
On X11, asks the window manager to keep
Since 2.4 gdk_window_set_opacity ()void gdk_window_set_opacity (GdkWindow *window, gdouble opacity);
Request the windowing system to make On X11, this works only on X screens with a compositing manager running.
For setting up per-pixel alpha, see
Since 2.12 gdk_window_set_composited ()void gdk_window_set_composited (GdkWindow *window, gboolean composited); Sets a GdkWindow as composited, or unsets it. Composited windows do not automatically have their contents drawn to the screen. Drawing is redirected to an offscreen buffer and an expose event is emitted on the parent of the composited window. It is the responsibility of the parent's expose handler to manually merge the off-screen content onto the screen in whatever way it sees fit. See Example 7, “Composited windows” for an example.
It only makes sense for child windows to be composited; see
An additional effect of this call is that the area of this window is no longer clipped from regions marked for invalidation on its parent. Draws done on the parent window are also no longer clipped by the child.
This call is only supported on some systems (currently,
only X11 with new enough Xcomposite and Xdamage extensions).
You must call
Since 2.12 gdk_window_move ()void gdk_window_move (GdkWindow *window, gint x, gint y);
Repositions a window relative to its parent window.
For toplevel windows, window managers may ignore or modify the move;
you should probably use
If you're also planning to resize the window, use
gdk_window_resize ()void gdk_window_resize (GdkWindow *window, gint width, gint height);
Resizes Windows may not be resized below 1x1.
If you're also planning to move the window, use
gdk_window_move_resize ()void gdk_window_move_resize (GdkWindow *window, gint x, gint y, gint width, gint height);
Equivalent to calling
gdk_window_scroll ()void gdk_window_scroll (GdkWindow *window, gint dx, gint dy); Scroll the contents of its window, both pixels and children, by the given amount. Portions of the window that the scroll operation brings in from offscreen areas are invalidated.
gdk_window_move_region ()void gdk_window_move_region (GdkWindow *window, const GdkRegion *region, gint dx, gint dy);
Move the part of Child windows are not moved.
Since 2.8 gdk_window_reparent ()void gdk_window_reparent (GdkWindow *window, GdkWindow *new_parent, gint x, gint y);
Reparents
gdk_window_clear ()void gdk_window_clear (GdkWindow *window);
Clears an entire
gdk_window_clear_area ()void gdk_window_clear_area (GdkWindow *window, gint x, gint y, gint width, gint height);
Clears an area of
gdk_window_clear_area_e ()void gdk_window_clear_area_e (GdkWindow *window, gint x, gint y, gint width, gint height);
Like This function has a stupid name because it dates back to the mists time, pre-GDK-1.0.
gdk_window_copy_area()#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) Warning
Deprecated equivalent to
gdk_window_raise ()void gdk_window_raise (GdkWindow *window);
Raises
If
gdk_window_lower ()void gdk_window_lower (GdkWindow *window);
Lowers
If
Note that
gdk_window_focus ()void gdk_window_focus (GdkWindow *window, guint32 timestamp);
Sets keyboard focus to
gdk_window_register_dnd ()void gdk_window_register_dnd (GdkWindow *window); Registers a window as a potential drop destination.
gdk_window_begin_resize_drag ()void gdk_window_begin_resize_drag (GdkWindow *window, GdkWindowEdge edge, gint button, gint root_x, gint root_y, guint32 timestamp); Begins a window resize operation (for a toplevel window). You might use this function to implement a "window resize grip," for example; in fact GtkStatusbar uses it. The function works best with window managers that support the Extended Window Manager Hints, but has a fallback implementation for other window managers.
gdk_window_begin_move_drag ()void gdk_window_begin_move_drag (GdkWindow *window, gint button, gint root_x, gint root_y, guint32 timestamp); Begins a window move operation (for a toplevel window). You might use this function to implement a "window move grip," for example. The function works best with window managers that support the Extended Window Manager Hints, but has a fallback implementation for other window managers.
gdk_window_constrain_size ()void gdk_window_constrain_size (GdkGeometry *geometry, guint flags, gint width, gint height, gint *new_width, gint *new_height); Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size).
gdk_window_beep ()void gdk_window_beep (GdkWindow *window);
Emits a short beep associated to
Since 2.12 gdk_window_begin_paint_rect ()void gdk_window_begin_paint_rect (GdkWindow *window, const GdkRectangle *rectangle);
A convenience wrapper around
gdk_window_begin_paint_region ()void gdk_window_begin_paint_region (GdkWindow *window, const GdkRegion *region);
Indicates that you are beginning the process of redrawing
The net result of all this is to remove flicker, because the user
sees the finished product appear all at once when you call
When using GTK+, the widget system automatically places calls to
If you call this function multiple times before calling the
matching
gdk_window_end_paint ()void gdk_window_end_paint (GdkWindow *window);
Indicates that the backing store created by the most recent call to
gdk_window_invalidate_rect ()void gdk_window_invalidate_rect (GdkWindow *window, const GdkRectangle *rect, gboolean invalidate_children);
A convenience wrapper around
gdk_window_invalidate_region ()void gdk_window_invalidate_region (GdkWindow *window, const GdkRegion *region, gboolean invalidate_children);
Adds
GDK will call
The
gdk_window_invalidate_maybe_recurse ()void gdk_window_invalidate_maybe_recurse (GdkWindow *window, const GdkRegion *region, gboolean (child_funcGdkWindow *, gpointer) (), gpointer user_data);
Adds
GDK will call
The
gdk_window_get_update_area ()GdkRegion* gdk_window_get_update_area (GdkWindow *window);
Transfers ownership of the update area from
gdk_window_freeze_updates ()void gdk_window_freeze_updates (GdkWindow *window);
Temporarily freezes a window such that it won't receive expose
events. The window will begin receiving expose events again when
gdk_window_thaw_updates ()void gdk_window_thaw_updates (GdkWindow *window);
Thaws a window frozen with
gdk_window_process_all_updates ()void gdk_window_process_all_updates (void);
Calls
gdk_window_process_updates ()void gdk_window_process_updates (GdkWindow *window, gboolean update_children);
Sends one or more expose events to
gdk_window_set_debug_updates ()void gdk_window_set_debug_updates (gboolean setting);
With update debugging enabled, calls to
In essence, because the GDK rendering model prevents all flicker, if you are redrawing the same region 400 times you may never notice, aside from noticing a speed problem. Enabling update debugging causes GTK to flicker slowly and noticeably, so you can see exactly what's being redrawn when, in what order.
The --gtk-debug=updates command line option passed to GTK+ programs
enables this debug option at application startup time. That's
usually more useful than calling
gdk_window_get_internal_paint_info ()void gdk_window_get_internal_paint_info (GdkWindow *window, GdkDrawable **real_drawable, gint *x_offset, gint *y_offset);
If you bypass the GDK layer and use windowing system primitives to
draw directly onto a GdkWindow, then you need to deal with two
details: there may be an offset between GDK coordinates and windowing
system coordinates, and GDK may have redirected drawing to a offscreen
pixmap as the result of a This function exposes details of the GDK implementation, and is thus likely to change in future releases of GDK.
gdk_window_enable_synchronized_configure ()void gdk_window_enable_synchronized_configure (GdkWindow *window);
Indicates that the application will cooperate with the window
system in synchronizing the window repaint with the window
manager during resizing operations. After an application calls
this function, it must call
On X, calling this function makes
Since 2.6 gdk_window_configure_finished ()void gdk_window_configure_finished (GdkWindow *window); Signal to the window system that the application has finished handling Configure events it has received. Window Managers can use this to better synchronize the frame repaint with the application. GTK+ applications will automatically call this function when appropriate.
This function can only be called if
Since 2.6 gdk_window_set_user_data ()void gdk_window_set_user_data (GdkWindow *window, gpointer user_data);
For most purposes this function is deprecated in favor of
gdk_window_set_override_redirect ()void gdk_window_set_override_redirect (GdkWindow *window, gboolean override_redirect); An override redirect window is not under the control of the window manager. This means it won't have a titlebar, won't be minimizable, etc. - it will be entirely under the control of the application. The window manager can't see the override redirect window at all. Override redirect should only be used for short-lived temporary windows, such as popup menus. GtkMenu uses an override redirect window in its implementation, for example.
gdk_window_set_accept_focus ()void gdk_window_set_accept_focus (GdkWindow *window, gboolean accept_focus);
Setting On X, it is the responsibility of the window manager to interpret this hint. ICCCM-compliant window manager usually respect it.
Since 2.4 gdk_window_set_focus_on_map ()void gdk_window_set_focus_on_map (GdkWindow *window, gboolean focus_on_map);
Setting On X, it is the responsibility of the window manager to interpret this hint. Window managers following the freedesktop.org window manager extension specification should respect it.
Since 2.6 gdk_window_add_filter ()void gdk_window_add_filter (GdkWindow *window, GdkFilterFunc function, gpointer data);
Adds an event filter to
See
gdk_window_remove_filter ()void gdk_window_remove_filter (GdkWindow *window, GdkFilterFunc function, gpointer data);
Remove a filter previously added with
GdkFilterFunc ()GdkFilterReturn (*GdkFilterFunc) (GdkXEvent *xevent, GdkEvent *event, gpointer data); Specifies the type of function used to filter native events before they are converted to GDK events.
When a filter is called,
enum GdkFilterReturntypedef enum { GDK_FILTER_CONTINUE, /* Event not handled, continue processesing */ GDK_FILTER_TRANSLATE, /* Native event translated into a GDK event and stored in the "event" structure that was passed in */ GDK_FILTER_REMOVE /* Terminate processing, removing event */ } GdkFilterReturn; Specifies the result of applying a GdkFilterFunc to a native event. GdkXEventtypedef void GdkXEvent; /* Can be cast to window system specific Used to represent native events (XEvents for the X11 backend, MSGs for Win32). gdk_window_shape_combine_mask ()void gdk_window_shape_combine_mask (GdkWindow *window, GdkBitmap *mask, gint x, gint y);
Applies a shape mask to
If On the X11 platform, this uses an X server extension which is widely available on most common platforms, but not available on very old X servers, and occasionally the implementation will be buggy. On servers without the shape extension, this function will do nothing. This function works on both toplevel and child windows.
gdk_window_shape_combine_region ()void gdk_window_shape_combine_region (GdkWindow *window, const GdkRegion *shape_region, gint offset_x, gint offset_y);
Makes pixels in
If On the X11 platform, this uses an X server extension which is widely available on most common platforms, but not available on very old X servers, and occasionally the implementation will be buggy. On servers without the shape extension, this function will do nothing. This function works on both toplevel and child windows.
gdk_window_set_child_shapes ()void gdk_window_set_child_shapes (GdkWindow *window);
Sets the shape mask of
gdk_window_merge_child_shapes ()void gdk_window_merge_child_shapes (GdkWindow *window);
Merges the shape masks for any child windows into the
shape mask for
This function is distinct from
gdk_window_input_shape_combine_mask ()void gdk_window_input_shape_combine_mask (GdkWindow *window, GdkBitmap *mask, gint x, gint y);
Like An input shape is typically used with RGBA windows. The alpha channel of the window defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the window is "clickable". On the X11 platform, this requires version 1.1 of the shape extension. On the Win32 platform, this functionality is not present and the function does nothing.
Since 2.10 gdk_window_input_shape_combine_region ()void gdk_window_input_shape_combine_region (GdkWindow *window, const GdkRegion *shape_region, gint offset_x, gint offset_y);
Like An input shape is typically used with RGBA windows. The alpha channel of the window defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the window is "clickable". On the X11 platform, this requires version 1.1 of the shape extension. On the Win32 platform, this functionality is not present and the function does nothing.
Since 2.10 gdk_window_set_child_input_shapes ()void gdk_window_set_child_input_shapes (GdkWindow *window);
Sets the input shape mask of
Since 2.10 gdk_window_merge_child_input_shapes ()void gdk_window_merge_child_input_shapes (GdkWindow *window);
Merges the input shape masks for any child windows into the
input shape mask for
This function is distinct from
Since 2.10 gdk_window_set_static_gravities ()gboolean gdk_window_set_static_gravities (GdkWindow *window, gboolean use_static); Set the bit gravity of the given window to static, and flag it so all children get static subwindow gravity. This is used if you are implementing scary features that involve deep knowledge of the windowing system. Don't worry about it unless you have to.
gdk_window_set_hints ()void gdk_window_set_hints (GdkWindow *window, gint x, gint y, gint min_width, gint min_height, gint max_width, gint max_height, gint flags); Warning
This function is broken and useless and you should ignore it.
If using GTK+, use functions such as
If using GDK directly, use
gdk_window_set_title ()void gdk_window_set_title (GdkWindow *window, const gchar *title);
Sets the title of a toplevel window, to be displayed in the titlebar.
If you haven't explicitly set the icon name for the window
(using
gdk_window_set_background ()void gdk_window_set_background (GdkWindow *window, const GdkColor *color);
Sets the background color of
The
See also
gdk_window_set_back_pixmap ()void gdk_window_set_back_pixmap (GdkWindow *window, GdkPixmap *pixmap, gboolean parent_relative);
Sets the background pixmap of
A background pixmap will be tiled, positioning the first tile at
the origin of
A background pixmap of
The windowing system will normally fill a window with its background
when the window is obscured then exposed, and when you call
GDK_PARENT_RELATIVE#define GDK_PARENT_RELATIVE 1L
A special value for gdk_window_set_cursor ()void gdk_window_set_cursor (GdkWindow *window, GdkCursor *cursor);
Sets the mouse pointer for a GdkWindow. Use
gdk_window_set_colormap#define gdk_window_set_colormap gdk_drawable_set_colormap Warning
Deprecated equivalent to gdk_window_get_user_data ()void gdk_window_get_user_data (GdkWindow *window, gpointer *data);
Retrieves the user data for
gdk_window_get_geometry ()void gdk_window_get_geometry (GdkWindow *window, gint *x, gint *y, gint *width, gint *height, gint *depth);
Any of the return location arguments to this function may be
The X and Y coordinates returned are relative to the parent window
of
On the X11 platform, the geometry is obtained from the X server,
so reflects the latest position of
NoteIfwindow is not a toplevel, it is much better
to call gdk_window_get_position() and gdk_drawable_get_size() instead,
because it avoids the roundtrip to the X server and because
gdk_drawable_get_size() supports the full 32-bit coordinate space,
whereas gdk_window_get_geometry() is restricted to the 16-bit
coordinates of X11.
gdk_window_set_geometry_hints ()void gdk_window_set_geometry_hints (GdkWindow *window, const GdkGeometry *geometry, GdkWindowHints geom_mask);
Sets the geometry hints for
This function provides hints to the windowing system about
acceptable sizes for a toplevel window. The purpose of
this is to constrain user resizing, but the windowing system
will typically (but is not required to) also constrain the
current size of the window to the provided values and
constrain programatic resizing via
Note that on X11, this effect has no effect on windows
of type
Since you can't count on the windowing system doing the
constraints for programmatic resizes, you should generally
call
gdk_window_set_icon_list ()void gdk_window_set_icon_list (GdkWindow *window, GList *pixbufs); Sets a list of icons for the window. One of these will be used to represent the window when it has been iconified. The icon is usually shown in an icon box or some sort of task bar. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality since the window manager may only need to scale the icon by a small amount or not at all.
gdk_window_set_modal_hint ()void gdk_window_set_modal_hint (GdkWindow *window, gboolean modal); The application can use this hint to tell the window manager that a certain window has modal behaviour. The window manager can use this information to handle modal windows in a special way.
You should only use this on windows for which you have
previously called
gdk_window_set_type_hint ()void gdk_window_set_type_hint (GdkWindow *window, GdkWindowTypeHint hint); The application can use this call to provide a hint to the window manager about the functionality of a window. The window manager can use this information when determining the decoration and behaviour of the window. The hint must be set before the window is mapped.
gdk_window_get_type_hint ()GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window); This function returns the type hint set for a window.
Since 2.10 gdk_window_set_skip_taskbar_hint ()void gdk_window_set_skip_taskbar_hint (GdkWindow *window, gboolean skips_taskbar);
Toggles whether a window should appear in a task list or window
list. If a window's semantic type as specified with
Since 2.2 gdk_window_set_skip_pager_hint ()void gdk_window_set_skip_pager_hint (GdkWindow *window, gboolean 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). If a
window's semantic type as specified with
Since 2.2 gdk_window_set_urgency_hint ()void gdk_window_set_urgency_hint (GdkWindow *window, gboolean urgent); Toggles whether a window needs the user's urgent attention.
Since 2.8 gdk_window_get_position ()void gdk_window_get_position (GdkWindow *window, gint *x, gint *y);
Obtains the position of the window as reported in the
most-recently-processed GdkEventConfigure. Contrast with
The position coordinates are relative to the window's parent window.
gdk_window_get_root_origin ()void gdk_window_get_root_origin (GdkWindow *window, gint *x, gint *y); Obtains the top-left corner of the window manager frame in root window coordinates.
gdk_window_get_frame_extents ()void gdk_window_get_frame_extents (GdkWindow *window, GdkRectangle *rect);
Obtains the bounding box of the window, including window manager
titlebar/borders if any. The frame position is given in root window
coordinates. To get the position of the window itself (rather than
the frame) in root window coordinates, use
gdk_window_get_size#define gdk_window_get_size gdk_drawable_get_size Warning
Deprecated equivalent of gdk_window_get_visual#define gdk_window_get_visual gdk_drawable_get_visual Warning
Deprecated equivalent of
gdk_window_get_colormap#define gdk_window_get_colormap gdk_drawable_get_colormap Warning
Deprecated equivalent of
gdk_window_get_type#define gdk_window_get_type gdk_window_get_window_type Warning
Deprecated equivalent of
gdk_window_get_origin ()gint gdk_window_get_origin (GdkWindow *window, gint *x, gint *y);
Obtains the position of a window in root window coordinates.
(Compare with
gdk_window_get_deskrelative_origin ()gboolean gdk_window_get_deskrelative_origin (GdkWindow *window, gint *x, gint *y); Warning
This gets the origin of a GdkWindow relative to an Enlightenment-window-manager desktop. As long as you don't assume that the user's desktop/workspace covers the entire root window (i.e. you don't assume that the desktop begins at root window coordinate 0,0) this function is not necessary. It's deprecated for that reason.
gdk_window_get_pointer ()GdkWindow* gdk_window_get_pointer (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask);
Obtains the current pointer position and modifier state.
The position is given in coordinates relative to the upper left
corner of
enum GdkModifierTypetypedef enum { GDK_SHIFT_MASK = 1 << 0, GDK_LOCK_MASK = 1 << 1, GDK_CONTROL_MASK = 1 << 2, GDK_MOD1_MASK = 1 << 3, GDK_MOD2_MASK = 1 << 4, GDK_MOD3_MASK = 1 << 5, GDK_MOD4_MASK = 1 << 6, GDK_MOD5_MASK = 1 << 7, GDK_BUTTON1_MASK = 1 << 8, GDK_BUTTON2_MASK = 1 << 9, GDK_BUTTON3_MASK = 1 << 10, GDK_BUTTON4_MASK = 1 << 11, GDK_BUTTON5_MASK = 1 << 12, /* The next few modifiers are used by XKB, so we skip to the end. * Bits 15 - 25 are currently unused. Bit 29 is used internally. */ GDK_SUPER_MASK = 1 << 26, GDK_HYPER_MASK = 1 << 27, GDK_META_MASK = 1 << 28, GDK_RELEASE_MASK = 1 << 30, GDK_MODIFIER_MASK = 0x5c001fff } GdkModifierType; A set of bit-flags to indicate the state of modifier keys and mouse buttons in various event types. Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock. Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.
Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped
to Mod2 - Mod5, and indicates this by setting
gdk_window_get_parent ()GdkWindow* gdk_window_get_parent (GdkWindow *window);
Obtains the parent of
gdk_window_get_toplevel ()GdkWindow* gdk_window_get_toplevel (GdkWindow *window);
Gets the toplevel window that's an ancestor of
gdk_window_get_children ()GList* gdk_window_get_children (GdkWindow *window);
Gets the list of children of The returned list must be freed, but the elements in the list need not be.
gdk_window_peek_children ()GList* gdk_window_peek_children (GdkWindow *window);
Like
gdk_window_get_events ()GdkEventMask gdk_window_get_events (GdkWindow *window);
Gets the event mask for
gdk_window_set_events ()void gdk_window_set_events (GdkWindow *window, GdkEventMask event_mask); The event mask for a window determines which events will be reported for that window. For example, an event mask including GDK_BUTTON_PRESS_MASK means the window should report button press events. The event mask is the bitwise OR of values from the GdkEventMask enumeration.
gdk_window_set_icon ()void gdk_window_set_icon (GdkWindow *window, GdkWindow *icon_window, GdkPixmap *pixmap, GdkBitmap *mask);
Sets the icon of
gdk_window_set_icon_name ()void gdk_window_set_icon_name (GdkWindow *window, const gchar *name); Windows may have a name used while minimized, distinct from the name they display in their titlebar. Most of the time this is a bad idea from a user interface standpoint. But you can set such a name with this function, if you like.
gdk_window_set_transient_for ()void gdk_window_set_transient_for (GdkWindow *window, GdkWindow *parent);
Indicates to the window manager that
See
gdk_window_set_role ()void gdk_window_set_role (GdkWindow *window, const gchar *role);
When using GTK+, typically you should use The window manager and session manager use a window's role to distinguish it from other kinds of window in the same application. When an application is restarted after being saved in a previous session, all windows with the same title and role are treated as interchangeable. So if you have two windows with the same title that should be distinguished for session management purposes, you should set the role on those windows. It doesn't matter what string you use for the role, as long as you have a different role for each non-interchangeable kind of window.
gdk_window_set_startup_id ()void gdk_window_set_startup_id (GdkWindow *window, const gchar *startup_id);
When using GTK+, typically you should use
Since 2.12 gdk_window_set_group ()void gdk_window_set_group (GdkWindow *window, GdkWindow *leader);
Sets the group leader window for The group leader window allows the window manager to distinguish all windows that belong to a single application. It may for example allow users to minimize/unminimize all windows belonging to an application at once. You should only set a non-default group window if your application pretends to be multiple applications.
gdk_window_get_group ()GdkWindow* gdk_window_get_group (GdkWindow *window);
Returns the group leader window for
Since 2.4 gdk_window_set_decorations ()void gdk_window_set_decorations (GdkWindow *window, GdkWMDecoration decorations);
"Decorations" are the features the window manager adds to a toplevel GdkWindow.
This function sets the traditional Motif window manager hints that tell the
window manager which decorations you would like your window to have.
Usually you should use
The Most window managers honor a decorations hint of 0 to disable all decorations, but very few honor all possible combinations of bits.
gdk_window_get_decorations ()gboolean gdk_window_get_decorations (GdkWindow *window, GdkWMDecoration *decorations); Returns the decorations set on the GdkWindow with gdk_window_set_decorations
enum GdkWMDecorationtypedef enum { GDK_DECOR_ALL = 1 << 0, GDK_DECOR_BORDER = 1 << 1, GDK_DECOR_RESIZEH = 1 << 2, GDK_DECOR_TITLE = 1 << 3, GDK_DECOR_MENU = 1 << 4, GDK_DECOR_MINIMIZE = 1 << 5, GDK_DECOR_MAXIMIZE = 1 << 6 } GdkWMDecoration; These are hints originally defined by the Motif toolkit. The window manager can use them when determining how to decorate the window. The hint must be set before mapping the window.
gdk_window_set_functions ()void gdk_window_set_functions (GdkWindow *window, GdkWMFunction functions); Sets hints about the window management functions to make available via buttons on the window frame. On the X backend, this function sets the traditional Motif window manager hint for this purpose. However, few window managers do anything reliable or interesting with this hint. Many ignore it entirely.
The
enum GdkWMFunctiontypedef enum { GDK_FUNC_ALL = 1 << 0, GDK_FUNC_RESIZE = 1 << 1, GDK_FUNC_MOVE = 1 << 2, GDK_FUNC_MINIMIZE = 1 << 3, GDK_FUNC_MAXIMIZE = 1 << 4, GDK_FUNC_CLOSE = 1 << 5 } GdkWMFunction; These are hints originally defined by the Motif toolkit. The window manager can use them when determining the functions to offer for the window. The hint must be set before mapping the window. gdk_window_get_toplevels ()GList* gdk_window_get_toplevels (void);
Obtains a list of all toplevel windows known to GDK on the default
screen (see
The returned list should be freed with
gdk_get_default_root_window ()GdkWindow* gdk_get_default_root_window (void); Obtains the root window (parent all other windows are inside) for the default display and screen.
GdkPointerHookstypedef struct { GdkWindow* (*get_pointer) (GdkWindow *window, gint *x, gint *y, GdkModifierType *mask); GdkWindow* (*window_at_pointer) (GdkScreen *screen, /* unused */ gint *win_x, gint *win_y); } GdkPointerHooks;
A table of pointers to functions for getting quantities related to
the current pointer position. GDK has one global table of this type,
which can be set using This is only useful for such low-level tools as an event recorder. Applications should never have any reason to use this facility
gdk_set_pointer_hooks ()GdkPointerHooks* gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks); This function allows for hooking into the operation of getting the current location of the pointer. This is only useful for such low-level tools as an event recorder. Applications should never have any reason to use this facility.
This function is not multihead safe. For multihead operation,
see
gdk_window_redirect_to_drawable ()void gdk_window_redirect_to_drawable (GdkWindow *window, GdkDrawable *drawable, gint src_x, gint src_y, gint dest_x, gint dest_y, gint width, gint height);
Redirects drawing into
Only drawing between
Redirection is active until
Since 2.14 gdk_window_remove_redirection ()void gdk_window_remove_redirection (GdkWindow *window);
Removes any active redirection started by
Since 2.14 |