summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/frames.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c
index f06c22be..8e6eefd3 100644
--- a/src/ui/frames.c
+++ b/src/ui/frames.c
@@ -195,8 +195,6 @@ meta_frames_init (MetaFrames *frames)
frames->invalidate_frames = NULL;
frames->cache = g_hash_table_new (g_direct_hash, g_direct_equal);
- gtk_widget_set_double_buffered (GTK_WIDGET (frames), FALSE);
-
meta_prefs_add_listener (prefs_changed_callback, frames);
}
@@ -2227,6 +2225,21 @@ subtract_client_area (cairo_region_t *region, MetaUIFrame *frame)
cairo_region_destroy (tmp_region);
}
+static MetaUIFrame *
+find_frame_to_draw (MetaFrames *frames,
+ cairo_t *cr)
+{
+ GHashTableIter iter;
+ MetaUIFrame *frame;
+
+ g_hash_table_iter_init (&iter, frames->frames);
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &frame))
+ if (gtk_cairo_should_draw_window (cr, frame->window))
+ return frame;
+
+ return NULL;
+}
+
static gboolean
meta_frames_draw (GtkWidget *widget,
cairo_t *cr)
@@ -2237,14 +2250,12 @@ meta_frames_draw (GtkWidget *widget,
cairo_region_t *region;
cairo_rectangle_int_t clip;
int i, n_areas;
- cairo_surface_t *target;
frames = META_FRAMES (widget);
- target = cairo_get_target (cr);
gdk_cairo_get_clip_rectangle (cr, &clip);
- g_assert (cairo_surface_get_type (target) == CAIRO_SURFACE_TYPE_XLIB);
- frame = meta_frames_lookup_window (frames, cairo_xlib_surface_get_drawable (target));
+ frame = find_frame_to_draw (frames, cr);
+
if (frame == NULL)
return FALSE;