Skip to content

Commit

Permalink
frames: don't bother painting the background
Browse files Browse the repository at this point in the history
GDK (and also GTK+!) do this for us already.

based on https://gitlab.gnome.org/GNOME/metacity/commit/1dcde194
  • Loading branch information
rcaridade145 authored and raveit65 committed Feb 21, 2020
1 parent 2acfffc commit 7adcd70
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/ui/frames.c
Original file line number Diff line number Diff line change
Expand Up @@ -2261,28 +2261,6 @@ meta_frames_destroy_event (GtkWidget *widget,
return TRUE;
}

static void
setup_bg_cr (cairo_t *cr, GdkWindow *window, int x_offset, int y_offset)
{
GdkWindow *parent = gdk_window_get_parent (window);
cairo_pattern_t *bg_pattern;

bg_pattern = gdk_window_get_background_pattern (window);
if (bg_pattern == NULL && parent)
{
gint window_x, window_y;

gdk_window_get_position (window, &window_x, &window_y);
setup_bg_cr (cr, parent, x_offset + window_x, y_offset + window_y);
}
else if (bg_pattern)
{
cairo_translate (cr, - x_offset, - y_offset);
cairo_set_source (cr, bg_pattern);
cairo_translate (cr, x_offset, y_offset);
}
}

/* Returns a pixmap with a piece of the windows frame painted on it.
*/
static cairo_surface_t *
Expand All @@ -2304,7 +2282,6 @@ generate_pixmap (MetaFrames *frames,
cr = cairo_create (result);
cairo_translate (cr, -rect->x, -rect->y);

setup_bg_cr (cr, frame->window, 0, 0);
cairo_paint (cr);

meta_frames_paint_to_drawable (frames, frame, cr);
Expand Down

0 comments on commit 7adcd70

Please sign in to comment.