diff options
author | Pablo Barciela <[email protected]> | 2019-02-18 10:08:24 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-03-10 17:33:56 +0100 |
commit | 8852f3b0881edf76a21f53775dd3b37a023ec4f3 (patch) | |
tree | 2f8d1914b71829ec6550adf2b94eb407d39731c4 /src/ui/frames.c | |
parent | e408410a289e9afdb6b3588db2a3475763a19c22 (diff) | |
download | marco-8852f3b0881edf76a21f53775dd3b37a023ec4f3.tar.bz2 marco-8852f3b0881edf76a21f53775dd3b37a023ec4f3.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/frames.c')
-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 816ebd8c..d1a62656 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -198,8 +198,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); } @@ -2293,6 +2291,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) @@ -2303,14 +2316,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; |