676
675
* easy to break GDK and/or GTK+, so you have to know what you're
677
676
* doing. Pass %NULL for @window to get all events for all windows,
678
677
* instead of events for a specific window.
679
* See gdk_display_add_client_message_filter() if you are interested
680
* in X ClientMessage events.
682
683
gdk_window_add_filter (GdkWindow *window,
1093
1095
g_object_unref (paint->pixmap);
1094
1096
gdk_region_destroy (paint->region);
1095
1097
g_free (paint);
1099
/* find a composited window in our hierarchy to signal its
1100
* parent to redraw, calculating the clip box as we go...
1102
* stop if parent becomes NULL since then we'd have nowhere
1103
* to draw (ie: 'composited' will always be non-NULL here).
1105
for (composited = private;
1107
composited = composited->parent)
1111
gdk_drawable_get_size (GDK_DRAWABLE (composited->parent),
1114
clip_box.x += composited->x;
1115
clip_box.y += composited->y;
1116
clip_box.width = MIN (clip_box.width, width - clip_box.x);
1117
clip_box.height = MIN (clip_box.height, height - clip_box.y);
1119
if (composited->composited)
1121
gdk_window_invalidate_rect (GDK_WINDOW (composited->parent),
1096
1126
#endif /* USE_BACKING_STORE */
2271
2298
if (!update_idle)
2273
update_idle = g_idle_add_full (GDK_PRIORITY_REDRAW,
2300
update_idle = gdk_threads_add_idle_full (GDK_PRIORITY_REDRAW,
2274
2301
gdk_window_update_idle, NULL, NULL);
2603
2630
child_region = gdk_region_rectangle (&child_rect);
2605
2632
/* remove child area from the invalid area of the parent */
2606
if (GDK_WINDOW_IS_MAPPED (child) && !child->shaped)
2633
if (GDK_WINDOW_IS_MAPPED (child) && !child->shaped &&
2607
2635
gdk_region_subtract (visible_region, child_region);
2609
2637
if (child_func && (*child_func) ((GdkWindow *)child, user_data))
3058
3086
return gdk_window_foreign_new_for_display (gdk_display_get_default (), anid);
3090
* gdk_window_set_composited:
3091
* @window: a #GdkWindow
3092
* @composited: %TRUE to set the window as composited
3094
* Sets a #GdkWindow as composited, or unsets it. Composited
3095
* windows do not automatically have their contents drawn to
3096
* the screen. Drawing is redirected to an offscreen buffer
3097
* and an expose event is emitted on the parent of the composited
3098
* window. It is the responsibility of the parent's expose handler
3099
* to manually merge the off-screen content onto the screen in
3100
* whatever way it sees fit. See <xref linkend="composited-window-example"/>
3103
* It only makes sense for child windows to be composited; see
3104
* gdk_window_set_opacity() if you need translucent toplevel
3107
* An additional effect of this call is that the area of this
3108
* window is no longer clipped from regions marked for
3109
* invalidation on its parent. Draws done on the parent
3110
* window are also no longer clipped by the child.
3112
* This call is only supported on some systems (currently,
3113
* only X11 with new enough Xcomposite and Xdamage extensions).
3114
* You must call gdk_display_supports_composite() to check if
3115
* setting a window as composited is supported before
3116
* attempting to do so.
3121
gdk_window_set_composited (GdkWindow *window,
3122
gboolean composited)
3124
GdkWindowObject *private = (GdkWindowObject *)window;
3125
GdkDisplay *display;
3127
g_return_if_fail (window != NULL);
3128
g_return_if_fail (GDK_IS_WINDOW (window));
3130
composited = composited != FALSE;
3132
if (private->composited == composited)
3135
display = gdk_drawable_get_display (GDK_DRAWABLE (window));
3137
if (!gdk_display_supports_composite (display) && composited)
3139
g_warning ("gdk_window_set_composited called but "
3140
"compositing is not supported");
3144
_gdk_windowing_window_set_composited (window, composited);
3146
private->composited = composited;
3061
3149
#define __GDK_WINDOW_C__
3062
3150
#include "gdkaliasdef.c"