diff options
author | Pablo Barciela <[email protected]> | 2019-02-18 10:08:24 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-16 18:12:44 +0200 |
commit | 147a9bd1e56201bb93879627cd186c235e050ca4 (patch) | |
tree | fb4e67017f2dd42411592f3caacfa48948932f13 /src/ui | |
parent | c819184cd7bb78b8c09b826ae151b2d9ff3f1650 (diff) | |
download | marco-147a9bd1e56201bb93879627cd186c235e050ca4.tar.bz2 marco-147a9bd1e56201bb93879627cd186c235e050ca4.tar.xz |
frames: avoid deprecated 'gtk_widget_set_double_buffered'
based in the mutter commits:
https://gitlab.gnome.org/GNOME/mutter/commit/b8b0dc5c78008647f5833f63d88456025f17bd08
https://gitlab.gnome.org/GNOME/mutter/commit/669c9da2a48d9a5573edee09065b8558c1d07035
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/frames.c | 23 |
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; |